script.Parent.MouseButton1Click:Connect(function()
if game:GetService(“Players”).LocalPlayer:GetRankInGroup(13824371) >= 3 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Mulberry”)
wait(0.5)
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:Connect(function()
if game:GetService(“Players”).Parent:GetRankInGroup(5122099) >= 3 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Mulberry”)
wait(0.5)
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
one way would be to use script.Parent and have a bunch of .Parent
another way is to use script:FindFirstAncestorOfClass(“Player”) to have the script check each parent until it finds the player for you
script.Parent.MouseButton1Click:Connect(function()
if game:GetService(“Players”)FindFirstAncestorOfClass(“Player”):GetRankInGroup(5122099) >= 3 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Mulberry”)
wait(0.5)
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:Connect(function()
if game:GetService(“Players”).Parent:GetRankInGroup(5122099) >= 3 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new(“Mulberry”)
script:FindFirstAncestorOfClass(“Player”), not game:GetService(“Players”):FindFirstAncestorOfClass(“Player”)
wait(0.5)
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end