also give me know if this topic is wrong but i dont found solutions for this script in devforum
Hello im tried to make script by watching tutorials from youtube,Devforum,and other sources because im only builder and i cant understand scripting so im only understand basics (no good teachers like friends because they only builders or modellers even youtube cant help)
but 1 script from video didnt worked so im used another one and when its worked im tried to make player reset because set humanoid health to 0 didnt worked
so basically here was 2 teams and gui
clicking on them made you switch team but you didnt reseted or died after pressing them, devforum didnt had topics like this and videos dont has solutions
im managed to try improve it so when you click it getting closed (so you dont need button)
heres script for both teams in buttons
local player = script.Parent.Parent.Parent.Parent.Parent.Name
script.Parent.MouseButton1Click:Connect(function()
game.Players[player].TeamColor = BrickColor.new("Steel blue")
script.Parent.MouseButton1Click:Connect(function()
game.Workspace.Humanoid.Health = 0
end)
script.Parent.Parent.Visible = false
end)