Will this work?

I’m trying to make it so I can spawn unlimited props but I don’t know how to do that one really, have unlimited health as in not take damage, and only for my SteamID. For the props it’s, http://wiki.garrysmod.com/?title=Gamemode.PlayerSpawnProp
But I don’t know how to add it. It would be great if someone could help. Also I quickly whipped this up, so I don’t know if there are errors. Thanks.
[lua]function DarkSpawn( ply )
if ply:SteamID() == “STEAM_0:1:18765762” ) then
ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " … ply:Nick() … "
Your priveledges have been loaded.() )

else

ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "

We hope you like this server, also - http://www.187ciclan.com() )

end

end
hook.Add( “PlayerSpawn”, “DarkSpawned”, DarkSpawn )

function playershouldtakedamage(victim, attacker)
if ply:SteamID() == “STEAM_0:1:18765762” ) then
return false
else
return true
end

hook.Add( “PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)
[/lua]

sbox_maxprops 999999999
sbox_godmode 1

You don’t need Lua for this.

I want it max props only for me though, that’s what you don’t get, not other people, just me. Sorry if I confused you in my thread.

[editline]08:12PM[/editline]

I am getting this error
autorun/RunOnServerStart.lua:2: ‘then’ expected near ‘)’
and as you can see on line two there is a “then” there and I even tried do, but it isn’t working.

[editline]08:14PM[/editline]

I also even tried - “then do” but nothing.

[lua] if ply:SteamID() == ( “STEAM_0:1:18765762” ) then [/lua]

Learn Lua first, please.

Didn’t I say this was a quick whipp up, jesus. Learn to read, I am sick and tired of people not reading stuff

[editline]08:40PM[/editline]

Sorry for sounding like a dick but what I was trying to say was, if you don’t have anything useful to say then don’t post, I am learning lua. This section is for questions, your answer is irrevilant and I don’t like it. But this was an example code of what I want not the final.

[lua]function DarkSpawn( ply )
if ply:SteamID() == “STEAM_0:1:18765762” ) then
ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " … ply:Nick() … "
Your priveledges have been loaded.() )

else

ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "

We hope you like this server, also - http://www.187ciclan.com() )

end

end
hook.Add( “PlayerSpawn”, “DarkSpawned”, DarkSpawn )

function playershouldtakedamage(victim, attacker)
if ply:SteamID() == “STEAM_0:1:18765762” ) then
return false
else
return true
end

hook.Add( “PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)[/lua]

to

[lua]
function DarkSpawn( ply )
if ( ply:SteamID() == “STEAM_0:1:18765762” ) then
ply:PrintMessage( HUD_PRINTTALK, “Welcome back, " … ply:Nick() … "
Your priveledges have been loaded.” )

else

ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "

We hope you like this server, also - http://www.187ciclan.com" )

end

end
hook.Add( “PlayerSpawn”, “DarkSpawned”, DarkSpawn )

function playershouldtakedamage(victim, attacker)
if ( ply:SteamID() == “STEAM_0:1:18765762” ) then
return false
else
return true
end

hook.Add( “PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)
[/lua]

to

[lua]
function DarkSpawn( ply )
if (ply:SteamID() == “STEAM_0:1:18765762”) then
ply:PrintMessage( HUD_PRINTTALK, “Welcome back, " … ply:Nick() … "
Your priveledges have been loaded.” )
else
ply:PrintMessage( HUD_PRINTTALK, “Welcome back, " … ply:Nick() … "
We hope you like this server, also - http://www.187ciclan.com” )
end
end

hook.Add(“PlayerSpawn”, “DarkSpawned”, DarkSpawn)

function playershouldtakedamage(victim, attacker)
if (victim:SteamID() == “STEAM_0:1:18765762”) then
return false
else
return true
end
end

hook.Add(“PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)
[/lua]

I’m testing it now and I see what you did, let me see if it works.

to

[lua]
local function DarkSpawn( ply )
ply:ChatPrint("Welcome back, " … ply:Nick() … ")
if (ply:SteamID() == “STEAM_0:1:18765762”) then
ply:ChatPrint(“Your privileges have been loaded.” )
else
ply:ChatPrint(“We hope you like this server, also - http://www.187ciclan.com” )
end
end
hook.Add(“PlayerSpawn”, “DarkSpawned”, DarkSpawn)

local function playershouldtakedamage(victim, attacker)
if (victim:SteamID() == “STEAM_0:1:18765762”) then
return false
end
end
hook.Add(“PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)[/lua]

to

[lua]
local function DarkSpawn( ply )
ply:ChatPrint("Welcome back, " … ply:Nick())
if (ply:SteamID() == “STEAM_0:1:18765762”) then
ply:ChatPrint(“Your privileges have been loaded.” )
else
ply:ChatPrint(“We hope you like this server, also - http://www.187ciclan.com” )
end
end
hook.Add(“PlayerSpawn”, “DarkSpawned”, DarkSpawn)

local function playershouldtakedamage(victim, attacker)
if (victim:SteamID() == “STEAM_0:1:18765762”) then
return false
end
end
hook.Add(“PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)[/lua]

Works fine but would this work if I added it

[lua]function DarkSpawn( ply )
if (ply:SteamID() == “STEAM_0:1:18765762”) then
ply:PrintMessage( HUD_PRINTTALK, “Welcome back, " … ply:Nick() … "
Your priveledges have been loaded.” )
ply:AddToUserGroup(“Admin”,"|187ci| D.A.R.K")
else
ply:PrintMessage( HUD_PRINTTALK, “Welcome back, " … ply:Nick() … "
We hope you like this server, also - http://www.187ciclan.com” )
end
end [/lua]

I added
[lua]
ply:AddToUserGroup(“Admin”,"|187ci| D.A.R.K")
[/lua]

to

[lua]
local function DarkSpawn( ply )
ply:ChatPrint("Welcome back, " … ply:Nick())
if (ply:SteamID() == “STEAM_0:1:18765762”) then
ply:ChatPrint(“Your privileges have been loaded.” )
ply:SetUserGroup(“admin”)
else
ply:ChatPrint(“We hope you like this server, also - http://www.187ciclan.com” )
end
end
hook.Add(“PlayerSpawn”, “DarkSpawned”, DarkSpawn)

local function playershouldtakedamage(victim, attacker)
if (victim:SteamID() == “STEAM_0:1:18765762”) then
return false
end
end
hook.Add(“PlayerShouldTakeDamage”, “playershouldtakedamage”, playershouldtakedamage)[/lua]

Works nicely, thanks.

[editline]09:31PM[/editline]

Also what about the max props one? I want it to be only my steam ID that has unlimited, can anyone help me there?

[editline]09:34PM[/editline]

Would it be something like this?

[lua]function Unlimited( ply )
if (ply:SteamID() == “STEAM_0:1:18765762”) then
return true
hook.Add( “PlayerSpawnProp”, “Unlimited”, Unlimited )[/lua]

to

[lua]function Unlimited( ply )
if (ply:SteamID() == “STEAM_0:1:18765762”) then
return true
else
return false
end
end
hook.Add( “PlayerSpawnProp”, “Unlimited”, Unlimited )[/lua]

to

[lua]function Unlimited( ply )
return (ply:SteamID() == “STEAM_0:1:18765762”)
end
hook.Add( “PlayerSpawnProp”, “Unlimited”, Unlimited )[/lua]

That stops anyone spawning props.
You’re an idiot.
[lua]local check = _R.Player.CheckLimit
function _R.Player:CheckLimit(…)
if self:SteamID() == “STEAM_0:1:18765762” then
return true
end
return check(self,…)
end[/lua]

I didn’t even read what he’s trying to do. I just noticed that octogon is an idiot.

And before anyone suggests it.
[lua]local check = _R.Player.CheckLimit
function _R.Player:CheckLimit(…)
return self:SteamID() == “STEAM_0:1:18765762” or check(self,…)
end[/lua]

[editline]12:50AM[/editline]

Hey that was my automerge you broke!

You and lexic are multiple idiots.

Does it count if a retard calls you an idiot? Or is it more of a compliment?
“You’re not as stupid as I am!! :downs:”