I have made a GUI where you can select your spawn its Insurgent spawn or Law Enforcement spawn. but i cant figure out the script.
local player = game.Players.LocalPlayer
local team = game.Teams.Insurgents
script.Parent.MouseButton1Click:Connect(function()
if player.Team = team
then
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-19.25, 11.564, -74.31)
else
script.Parent.Parent.WT.Visible = true
wait(5)
script.Parent.Parent.WT.Visible = false
end
end)
The = sign from
if player.Team = team
has a red line under it
- Logan

2 comments
well if you're checking something I'm pretty sure there should be two ='s
Im now getting this error: attempt to index upvalue 'player' (a nil value)