• Will this work?
    20 replies, posted
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, [url]http://wiki.garrysmod.com/?title=Gamemode.PlayerSpawnProp[/url] 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() .. "\nYour priveledges have been loaded.() ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe hope you like this server, also - [url]http://www.187ciclan.com([/url]) ) 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() .. "\nYour priveledges have been loaded.() ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe hope you like this server, also - [url]http://www.187ciclan.com([/url]) ) 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() .. "\nYour priveledges have been loaded." ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe 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]
[QUOTE=octogon;17782006][lua]function DarkSpawn( ply ) if ply:SteamID() == "STEAM_0:1:18765762" ) then ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nYour priveledges have been loaded.() ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe hope you like this server, also - [url]http://www.187ciclan.com([/url]) ) 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() .. "\nYour priveledges have been loaded." ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe 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][/QUOTE] to [lua] function DarkSpawn( ply ) if (ply:SteamID() == "STEAM_0:1:18765762") then ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nYour priveledges have been loaded." ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe 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.
[QUOTE=Chrisaster;17782062]to [lua] function DarkSpawn( ply ) if (ply:SteamID() == "STEAM_0:1:18765762") then ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nYour priveledges have been loaded." ) else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe 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][/QUOTE] 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]
[QUOTE=Lexic;17782218]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][/QUOTE] 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() .. "\nYour priveledges have been loaded." ) ply:AddToUserGroup("Admin","|187ci| D.A.R.K") else ply:PrintMessage( HUD_PRINTTALK, "Welcome back, " .. ply:Nick() .. "\nWe 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]
[QUOTE=Chrisaster;17782295]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][/QUOTE]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]
[QUOTE=Justin37111;17782771] [lua]function Unlimited( ply ) if (ply:SteamID() == "STEAM_0:1:18765762") then return true hook.Add( "PlayerSpawnProp", "Unlimited", Unlimited )[/lua][/QUOTE] 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]
[QUOTE=octogon;17784761]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][/QUOTE] to [lua]function Unlimited( ply ) return (ply:SteamID() == "STEAM_0:1:18765762") end hook.Add( "PlayerSpawnProp", "Unlimited", Unlimited )[/lua]
[QUOTE=octogon;17784761]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][/QUOTE] 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!
[QUOTE=Skapocalypse;17785161]I didn't even read what he's trying to do. I just noticed that octogon is an idiot.[/QUOTE] You and lexic are multiple idiots.
[QUOTE=octogon;17791823]You and lexic are multiple idiots.[/QUOTE] 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:"
[QUOTE=Lexic;17792641]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:"[/QUOTE] So you're the retard, ignored all your post from now on!
Sorry, you need to Log In to post a reply to this thread.