Pivity

How to disallow spawning in addon props?

Last read Never
#1

So any player on my server can spawn in things in this thing:

https://gyazo.com/4ee3e224ab648d7db71f61228530e1ea


I dont know how to disable it but anyone is able to spawn addon props (but not ragdolls or anything like that ive already made the limit 0)

#2
local propWhitelist = {
[ "models/creator_2013/vehicles/opel_insignia_2017.mdl" ] = true
}


hook.Add( "PlayerSpawnProp", "NoAddonProps", function( ply, model )


if propWhitelist[ model ] then return end
local files = file.Find( model, "THIRDPARTY" )
if files and #files > 0 then return false end


end )

Place this inside a lua file in /lua/autorun/server. You can call the lua file something like anti_addon_spawn.lua, but make sure that no other addon is using this name.

This code disallows every player to spawn models which were hooked by addons or gamemodes. You also have the ability to add whitelisted props.

Winner x 1Friendly x 1Informative x 1
#3

Thanks, it fixed my problem : )

Users viewing this thread
Nobody