local InteractionsPart = game.Workspace.WorkspaceInteractions.WardenTeamChange
local TeamToChange = InteractionsPart.TeamChangeValue.Value
local ReplicatedStorageEvent = game.ReplicatedStorage.Static.Events.TeamChange
local PlayerYes = game.Players.LocalPlayer
local OnTeamYes = false
local UserInputYes = game:GetService("UserInputService")
UserInputYes.InputBegan:Connect(function(Keybind, IsTyping)
local PlayerandPartDistanceYes = (InteractionsPart.Position - PlayerYes.Character:FindFirstChild("HumanoidRootPart").Position).Magnitude
if not IsTyping then
if Keybind.KeyCode == Enum.KeyCode.G then
if PlayerandPartDistanceYes <= 5 then
if OnTeamYes == false then
OnTeamYes = true
ReplicatedStorageEvent:FireServer(TeamToChange)
InteractionsPart:FindFirstChild("Prompt").Frame.TextLabel.Text = "Leave Team (GC)"
else
OnTeamYes = false
InteractionsPart:FindFirstChild("Prompt").Frame.TextLabel.Text = "Join Team (GC)"
end
end
end
end
end)
The bug is the value of OnTeam is just coming back as true all the time, it is not changing at all