For some reason this code doesn’t work. It doesn’t even print the message, even if I use lua_openscript
And there are no errors printed either.
[lua]
function SpawnHatLady()
if SERVER then
if ( string.find( string.lower( game.GetMap() ), “colz_” ) ) then
–Lol, no code for this yet
elseif ( string.lower( game.GetMap() ) == “rp_downtown_v2” ) then
–setpos -2862.375000 -1985.343750 -49.875000;setang -1.381697 0.827408 0.000000
local hatlady = ents.Create( "snpc_hatlady" )
hatlady:SetPos( Vector(-2862.375000,-1985.343750,-49.875000) )
hatlady:SetAngles( Angle(-1.381697,0.827408,0.000000) )
hatlady:Spawn()
hatlady:DropToFloor()
for k,v in pairs(player.GetAll()) do
print("well.. your Hat Lady has spawned. :O")
end
else
for k,v in pairs(player.GetAll()) do
print("FATAL ERROR: Invalid Map")
end
end
end
end
hook.Add( “InitPostEntity”, “SpawnHatLady”, SpawnHatLady )
[/lua]