Also nochmal ganz von vorne in die init.lua soll jetzt
Code:
function SpawnFirstTable()
local tr = LocalPlayer:GetEyeTrace()
local Table = ents.Create( "prop_physics" )
Table:SetModel ("models/props_c17/FurnitureTable002a.mdl" )
Table:SetPos( tr.HitPos )
Table:Spawn()
end
und in die client seitige lua:
Code:
include ("init.lua")
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,150 )
DermaPanel:SetSize( 700, 500 )
DermaPanel:SetTitle( "Spawn Furnitures" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Table" )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
SpawnFirstTable()
end
Dann kommt nämlich

Zitat von
Console
SantoRP\gamemode\init.lua:2: attempt to index global 'LocalPlayer' (a function value)D