• Help with <eof> error.
    10 replies, posted
Hi, I am trying to create a simple plugin that notifies players their name and map name when they join my server. I have this so far: [CODE] ply:ChatPrint("Welcome to Sycotic-Gaming | Sandbox #1, " .. LocalPlayer():GetName() .. " on " .. game.GetMap() .. " !") end end [/CODE] Am I missing something?
1. There's no function 2. You have too many ends.
[QUOTE=code_gs;44837646]1. There's no function 2. You have too many ends.[/QUOTE] What do I need to add as a function?
[QUOTE=TheSenDest;44837672]What do I need to add as a function?[/QUOTE] When do you want to print it?
[QUOTE=code_gs;44837708]When do you want to print it?[/QUOTE] On spawn, I have been at this for about 25 minutes and I keep getting <eof> errors.
[code]hook.Add( "PlayerInitialSpawn", "welcome", function( ply ) ply:ChatPrint("Welcome to Sycotic-Gaming | Sandbox #1, " .. LocalPlayer():GetName() .. " on " .. game.GetMap() .. " !") end )[/code]
Thank you! Btw, what is the "welcome" part about? What does that do?
[QUOTE=TheSenDest;44837814]Thank you! Btw, what is the "welcome" part about? What does that do?[/QUOTE] That's a hook identifier, you can name it anything.
[QUOTE=code_gs;44837822]That's a hook identifier, you can name it anything.[/QUOTE] Got it. I am new to the hook thing. Does it do what the literal definition of a hook says? Or does it do something completely opposite?
[QUOTE=TheSenDest;44837829]Got it. I am new to the hook thing. Does it do what the literal definition of a hook says? Or does it do something completely opposite?[/QUOTE] What do you mean by "definition?" If you mean the event, then it does exactly what is says, print it on a player's first spawn. Here's the hook documentation if you need it: [url]http://wiki.garrysmod.com/page/hook/Add[/url]
[QUOTE=code_gs;44837841]What do you mean by "definition?" If you mean the event, then it does exactly what is says, print it on a player's first spawn. Here's the hook documentation if you need it: [url]http://wiki.garrysmod.com/page/hook/Add[/url][/QUOTE] I must have worded it wrong, but that's what I was looking for. Thanks!
Sorry, you need to Log In to post a reply to this thread.