Sandbox

i want to make so admins can spawn so many props and things they want i did find this in sandbox’s player.lua

[lua]
local function LimitReachedProcess( ply, str )

// Always allow in single player
if (SinglePlayer()) then return true end

local c = server_settings.Int( "sbox_max"..str, 0 )

if ( ply:GetCount( str ) < c || c < 0 ) then return true end 

ply:LimitHit( str ) 
return false

[/lua]
end

i tryd to change the
[lua]
if (SinglePlayer()) then return true end
[/lua]
to
[lua]
if ply:IsAdmin then return true end
[/lua]
but didnt work how then?

I’m not sure I understand your question, but please use [noparse][lua][/lua][/noparse] tags around your lua script. It makes it easier to read.

i want to make so admins have no limits

like the assmod

I solved it :smiley:
i found a ULX plugin that did make it
[lua]
local function LimitReachedProcess( ply, str )

// Always allow in single player
if (SinglePlayer()) then return true end

local c = server_settings.Int( "sbox_max"..str, 0 )

if ply:IsAdmin() or ply:IsSuperAdmin() then
	return true
end

if ( ply:GetCount( str ) < c || c < 0 ) then return true end

ply:LimitHit( str )
return false

end

local function init()


– Name: gamemode:PlayerSpawnRagdoll( ply, model )
– Desc: Return true if it’s allowed


function GAMEMODE:PlayerSpawnRagdoll( ply, model )

return LimitReachedProcess( ply, "ragdolls" )

end


– Name: gamemode:PlayerSpawnProp( ply, model )
– Desc: Return true if it’s allowed


function GAMEMODE:PlayerSpawnProp( ply, model )

return LimitReachedProcess( ply, "props" )

end


– Name: gamemode:PlayerSpawnEffect( ply, model )
– Desc: Return true if it’s allowed


function GAMEMODE:PlayerSpawnEffect( ply, model )

return LimitReachedProcess( ply, "effects" )

end


– Name: gamemode:PlayerSpawnVehicle( ply )
– Desc: Return true if it’s allowed


function GAMEMODE:PlayerSpawnVehicle( ply )

return LimitReachedProcess( ply, "vehicles" )

end


– Name: gamemode:PlayerSpawnSENT( ply, name )
– Desc: Return true if player is allowed to spawn the SENT


– Commented out since Garry’s now just always returns true. This may change some day…year…etc
– function GAMEMODE:PlayerSpawnSENT( ply, name )

– return LimitReachedProcess( ply, “sents” )

– end


– Name: gamemode:PlayerSpawnNPC( ply, npc_type )
– Desc: Return true if player is allowed to spawn the NPC


function GAMEMODE:PlayerSpawnNPC( ply, npc_type, equipment )

return LimitReachedProcess( ply, "npcs" )

end

local meta = FindMetaTable( “Player” )
// Return if there’s nothing to add on to
if (!meta) then return end

function meta:CheckLimit( str )

// No limits in single player
if (SinglePlayer()) then return true end

local c = server_settings.Int( "sbox_max"..str, 0 )

if self:IsAdmin() or self:IsSuperAdmin() then
	return true
end

if ( c < 0 ) then return true end
if ( self:GetCount( str ) > c-1 ) then self:LimitHit( str ) return false end

return true

end

end

hook.Add( “Initialize”, “LimitInitilize”, init )
[/lua]

Your old one would have worked. You need “ply:IsAdmin()” rather than “pl:IsAdmin”.