Here is the code:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
local redgear = game.ReplicatedStorage:WaitForChild("Five-Seven Candy")
if plr.Backpack:FindFirstChild('KF5') or plr.StarterGear:FindFirstChild('KF5') or game.Workspace[plr.Name]:FindFirstChild('KF5') then
if plr.Backpack:FindFirstChild('KF5') then
plr.Backpack:FindFirstChild('KF5'):Destroy()
end
if plr.StarterGear:FindFirstChild('KF5') then
plr.StarterGear:FindFirstChild('KF5'):Destroy()
end
if game.Workspace[plr.Name]:FindFirstChild('KF5') then
game.Workspace[plr.Name]:FindFirstChild('KF5'):Destroy()
end
end
redgear:Clone().Parent = plr.Backpack -- FROM HERE ON IS THE RESPAWN AND TEAMCHANGE
redgear:Clone().Parent = plr.StarterGear
plr.TeamColor = BrickColor.new('Bright red') -- teamchange
plr:LoadCharacter() -- respawn
end)
So, all I know is that the section labeled "teamchange" and "respawn" is NOT working, sadly. I make it so that local plr = game.Players.LocalPlayer which makes it so that plr = localplayer. then when it goes to teamchange, I have the simple stuff done, like the teamcolor. The spawn color matches bright red. I see no issues, and plr:LoadCharacter is a respawn function so you dont have to wait 5 seconds + a death, if anyone can help me out here it would be much apperciated. Thanks, bye.
