This plugin does not use ULX. (Don't see why we cant put normal scripts here too)
I was just practicing lua (gotten quite good now) and this is the result:
A script that:
- Announces whomever spawns a chimney in red (center of screen)
- Returns player to spawn (and notifies them)
- Plays alarm sound
- Blocks the spawning of the chimney
Copy and paste into a LUA file and put in gmod9/lua.
Type lua_openscript (nameoffile).lua and your set.
function eventPlayerSpawnProp(userid,propspa)
if propspa == "models/props_animated_breakable/Smokestack.mdl" then
_PluginMsg(userid, "You have been returned to the spawnpoint","lol",10,255,0,0,255,10);
_ScreenText(0, _PlayerInfo(userid, "name") .. " tried to spawn a chimney!", -1,0.2, 255,0,0,255, 1,3, 6, 0, 1);
_PlayerRespawn(userid)
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
CONCOMMAND("chimney_script", GDsay);
return false;
else
return true;
end
end
function GDsay(userid)
_ScreenText(0, "Chimney Script by Golden-Death", -1,0.2, 0,0,255,255, 1,3, 6, 0, 1);
end
How you can help:Please tell me if you can verify that the red text that announces the player who spawned the chimney properly names the player, and shows up on every ones screens
Bugs/To Do:Find a way to temporarily disable, in the offchance anyone really must have a chimney.