• Currency System error
    4 replies, posted
Well, I have made my own Money system... and I have no idea if I have done this right. But I know I have.. [CODE]function GM:PlayerInitialSpawn( ply ) if (ply:GetPData( "coins" ) == nil) then ply:SetNWInt( "coins", 100 ) ply:SetNWString( "location", "UNKNOWN" ) else ply:SetNWInt( "coins", ply:GetPData( "coins" ) ) ply:SetNWString( "location", "UNKNOWN" ) end -- Place Checker timer.Create( "LocationTimer", 1, 0, function() if !ply:Alive() then ply:SetNWString( "location", "HEAVEN" ) elseif ply:Alive() then ply:SetNWString( "location", "OUTSIDE" ) end end) end[/CODE] And this is meant to load when the Player Joins but it dosen't! In my addon I used Hook.Add, and it worked... as soon as I add this to my Gamemode its like, nope I don't want to work anymore! And when they disconnect it sets there PData... but when they join it dosen't load. But if I reload the gamemode it works? wtf... Anyone know>
Unrelated but you could just use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeath]GM:PlayerDeath[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSpawn]GM:PlayerSpawn[/url] to set the location to heaven or outside rather than a timer
[QUOTE=MPan1;50882084]Unrelated but you could just use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeath]GM:PlayerDeath[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSpawn]GM:PlayerSpawn[/url] to set the location to heaven or outside rather than a timer[/QUOTE] What do you mean unrelated? Its my Currency like Money.. it dosent load on spawn
[QUOTE=jacobcooper18;50882185]What do you mean unrelated?[/QUOTE] I mean my post was unrelated to the problem. Also, where's this file (the one with the GM:PlayerIntialSpawn thing) located? Maybe it's in a location where it isn't being run or something
[QUOTE=MPan1;50882204]I mean my post was unrelated to the problem. Also, where's this file (the one with the GM:PlayerIntialSpawn thing) located? Maybe it's in a location where it isn't being run or something[/QUOTE] init.lua, and everything in it loads but it... any ideas?
Sorry, you need to Log In to post a reply to this thread.