so i have problems with my team changer
cant really say anything else of it, just look what i do here
code:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if plr:IsInGroup(7417509) then
if plr:GetRankInGroup(7417509) >= 15 then
plr.Team = game.Teams.Instructors
end
end
end)
UnrefinedRank = script.Parent.Parent.Parent.Parent.Parent:GetRankInGroup(7417509)
function Click(mouse)
if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(7417509) then
if UnrefinedRank > 15 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Institutional white")
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
end
end
script.Parent.MouseButton1Click:connect(Click)
Make sure you are using a regular script, not localscript
local ClickDetector = script.Parent
ClickDetector.MouseClick:Connect(function(player)
if player:GetRankInGroup(7417509) == 255 then
print("Player is the owner of the group")
else
print("Player is not the owner of the group")
end
end)
means “greater than” or “higher than” meaning if I was in the group 7417509 and lower than the rank “15” this will not work as the script will only allow players with the rank 15 +.
Im not a very experienced coder but I THINK “=” is “Equal to” meaning if I was the rank 15 and the script was ( if plr:GetRankInGroup(7417509) == 15 then ) only the rank 15 can change to this team.
function Click(mouse)
if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(7417509) then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Burgundy")
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
end
script.Parent.MouseButton1Click:connect(Click)