Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Commands for Balancing teams and gearing players on command? (This time in Code Block)

Asked by 10 years ago

What is wrong with the scripts?

local function reteam() local x = math.random(2) for _, player in next, game.Players:GetPlayers() do x = (x + ((player.TeamColor == BrickColor.new("White")) and 1 or 0)) player.TeamColor = BrickColor.new((player.TeamColor ~= BrickColor.new("White")) and player.TeamColor.Name or (((x % 2) == 0) and "Really Blue" or "Really red")) end end
local admins = {"Incrility"}

function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end

function onChatted(message, player) if message == "!setmode rcl" and tableContains(admins, player.Name) then reteam() end end

And Also

function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end

function onChatted(message, player)

if input:sub(1, 9):lower() == "!setmode " and tableContains(admins, player.Name) then --If letters 1 to 9 are !setmode local tool = game.Lighting.tools:FindFirstChild(input:sub(10):lower()) if tool then tool:Clone().Parent = player.backpack tool:clone().parent = game.StarterPack end end

This was supposed to get the weapon named "sword" which is in Lighting under Tools and give it to player both in the backpack and starterpack... on command "!setmode Sword"

0
Again i Did notice the missing end, but upon fixing it nothing changed also when i wrote it i accidentaly added the -- but in real script that is not there yet it still doesnt work... Incrility 0 — 10y
0
BUMP... Incrility 0 — 10y

Answer this question