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

Team Change Cloner| Only Working In Studios?

Asked by 8 years ago

Idea This Script is made to clone everything in a model and put it into the players character when they change teams, Any it worked Fine :D (In Studios)
Problem I tried to use this script in game, and it would not do anything, and gave no outputs.
Code:

------------------------------------
plr = game.Players.LocalPlayer
char = plr.Character
--------------------------
DiverModel = game.ReplicatedStorage.CharacterList.Diver
----------------------------------------------------------------------
repeat wait() until  char ~= nil and plr.TeamColor ~= BrickColor.new("White")
----------------------------------------------------------------------
function GiveParts(Model)
    for _, Object in pairs(Model:GetChildren()) do
        Object:Clone().Parent = char
    end
end
--------------------
function OnChanged()
if plr.TeamColor == BrickColor.new("Crimson") then
    GiveParts(DiverModel)
elseif plr.TeamColor == BrickColor.new("Quill grey") then
    GiveParts(DiverModel)
elseif plr.TeamColor == BrickColor.new("Storm blue") then
    GiveParts(DiverModel)
end
end
plr.Changed:connect(OnChanged)
------------------------------

Thanks

0
LocalScript or Script? grasheeno 70 — 8y
0
local pluginfactory 463 — 8y

Answer this question