• Props not showing?
    7 replies, posted
Hi, I've made this ATM code for these bank atms to spawn on my PERP server. I've tested this code on my side first and it worked. But for some reason it doesn't work when I put in the server. Can someone help me please? [lua]if SERVER then AddCSLuaFile("atms.lua") end --PERP3 EvoCity v33x ATM's --Towyard (ATM #1) local towyard = ents.Create( "prop_physics" ) towyard:SetModel("models/PERP2/bank_atm/bank_atm.mdl") towyard:SetPos(Vector(842, 4430, 72)) towyard:SetAngles(Angle(0, 180, 0)) towyard:Spawn() --Sububrs Gas Station (ATM #2) local suburbs = ents.Create( "prop_physics" ) suburbs:SetModel("models/PERP2/bank_atm/bank_atm.mdl") suburbs:SetPos(Vector(10519, 13493, 66)) suburbs:SetAngles(Angle(0, -180, 0)) suburbs:Spawn() --Hospital (ATM #3) local hospital = ents.Create( "prop_physics" ) hospital:SetModel("models/PERP2/bank_atm/bank_atm.mdl") hospital:SetPos(Vector(-9875, 9413, 72)) hospital:SetAngles(Angle(0, 0, 0)) hospital:Spawn()[/lua]
Just making sure: The AddCSLuaFile() is working, correct? You're also include()-ing this atms.lua in the appropriate file? (init.lua/shared.lua/cl_init.lua)
Well no, I'm just putting it in the lua/autorun. Is there some place I need to put it?
[QUOTE=xmathewx75;34263876]Well no, I'm just putting it in the lua/autorun. Is there some place I need to put it?[/QUOTE] I'd have hooked it in the gamemode itself.
[QUOTE=xmathewx75;34263876]Well no, I'm just putting it in the lua/autorun. Is there some place I need to put it?[/QUOTE] Put it in "lua/autorun/server/" and come back with results. Your "if SERVER" line won't be triggered (I don't think) if you just leave it in the general "autorun" folder. You said it worked on your side, how did you initially test it?
-snipsnap Read it wrong-
If I'm supposed to create a hook, can someone do it for me? I'm not so pro or good at lua.
[QUOTE=xmathewx75;34277046]If I'm supposed to create a hook, can someone do it for me? I'm not so pro or good at lua.[/QUOTE] Yarrgh! [URL="http://www.facepunch.com/forums/53"]Requests[/URL] be thataway! Otherwise you can look into [URL="http://wiki.garrysmod.com/?title=Gamemode.InitPostEntity"]Gamemode.InitPostEntity[/URL] and hook onto that.
Sorry, you need to Log In to post a reply to this thread.