• Blocking spawn point prop - script
    4 replies, posted
  • Avatar of men232
  • Hi I have a server with the gamemode darkrp. Often the server Mingi block spawn prop. Is there a script or addon to solve this problem? [highlight](User was banned for this post ("Wrong section" - Gran PC))[/highlight]
  • Avatar of Matt W
  • You could use ents.FindInSphere to get the location of spawn and then remove any props inside. Example: [lua] function SpawnProtection() for k,v in pairs(ents.FindInSphere(Vector(1,1,1), 256) do -- You need to replace 1,1,1 with the co-ordinates of your map (use getpos in console) if v:GetClass() == "prop_physics" then v:Remove() end end end hook.Add("Think", "SpawnProtection", SpawnProtection) [/lua] ^^ Something like that.
  • excuse me How would one incorporate this code? Plug into a previous script? Perhaps paste in a txt file and put in lua folder? any help is appreciated thanks [I]Ive been searching 3 hours and read many stickys[/I]
  • Avatar of brandonj4
  • [QUOTE=jjkjoo;35781211]excuse me How would one incorporate this code? Plug into a previous script? Perhaps paste in a txt file and put in lua folder? any help is appreciated thanks [I]Ive been searching 3 hours and read many stickys[/I][/QUOTE] You would make a file with the extention ".lua" and place inside of garrysmod/lua/autorun/client or garrysmod/lua/autorun/server depending on the type of code. In this case it would be serverside because the server has to delete the prop.