I don't know what I did wrong with my script please help
local Deploy = script.Parent
local DeploySet = script.Parent
local team = game.Players.LocalPlayer.Team
local part1 = game.Workspace.Team1Part
local part2 = game.Workspace.Team2Part
if inputObject.KeyCode == Enum.KeyCode.E then
if team == "Allies" then
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = part1.CFrame
elseif team == "Axis" then
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = part2.CFrame
end
Deploy.Visible = false
DeploySet.Visible = false
end
It's supposed to hide the UI and teleport the player to a certain part accordingly to the players team. I thought the script would work but apparently not.