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?

Asked by 10 years ago

What is wrong with the scripts?

  1. 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

Script is intended to take players from team "trainee"(The color is white) and move them to 2 other teams Red and Blue (colors are Really Red and Really blue) The teams must be equal in size also the 2 other teams TRAINER "Black" and Green (Really Green) Must not be affected... IDK what i did wrong...

And Also

  1. 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 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
I did notice the missing end at in the second function and i added it still no success Incrility 0 — 10y
1
Please put the code in a Code block. TheeDeathCaster 2368 — 10y

Answer this question