• Usermessage Error Help
    7 replies, posted
Hey everyone, so ive been just starting to learn usermessages and got a simple one to work but now Im getting an error on another one. The error is: "Attempt to index global 'umsg's (a nil value)" I dont know what this means and cant seem to figure it out. The code on the line that its coming from is: umsg.Start( "BailOut", self.Owner ) umsg.Short(offerAmount:GetValue()) umsg.Entity(self.Owner) umsg.End() And then when I get that error and look into my SRCDS it says I have a error at line 54 and the error is: attempt to index global 'vgui' (a nil value). That line is: local frame1 = vgui.Create("DFrame") That doesnt make sense to me because the frame shows up just fine. This is all in a weapon file for DarkRP. If anyone could help that would be great. [highlight](User was banned for this post ("Wrong forum" - Grea$eMonkey))[/highlight]
Are you trying to use usermessages client side?
No that code is in the server.
You're using it shared.
How do I change that?
Stop calling the code on the client's side.
Enclose the code you want to run on the server with [lua] if SERVER then end [/lua] or even better: split the clientside code from the serverside code and only load / include each file where it is needed.
For the usermessage though I have an "if SERVER then" statement already enclosed around it
Sorry, you need to Log In to post a reply to this thread.