Have trouble with a fuction that isn't ending when it should
5 replies, posted
I am getting this error
[ERROR] addons/starwars weaponshop/lua/entities/default/init.lua:35: 'end' expected (to close 'function' at line 25) near '<eof>'
1. unknown - addons/starwars weaponshop/lua/entities/default/init.lua:0
From
function ENT:Use( activator, caller )
if IsValid(caller ) and caller:IsPlayer() then
net.Start("SWRPOpenShopMenu")
net.Send("SWRPOpenShopMenu")
end
it has an end so i would think it would work but idk
the if statement is never ended.
As swept said you need an end to the if statement because as of right now it looks like you only have an end for the function.
So it'd look like:
function ENT:Use( activator, caller )if IsValid(caller ) and caller:IsPlayer() then
net.Start("SWRPOpenShopMenu")
net.Send("SWRPOpenShopMenu")
end
end
Basic Mistake
As stated before you need an end for your if statement. There is however a second issue here and it's how you're trying to call net.Send, read the wiki for clarification on how to use the network library.
thanks for everyones support
Sorry, you need to Log In to post a reply to this thread.