I added typeof but then it says I need an =, so I put that in but then it says that: "built in global 'typeof' is overwritten here; consider using a local or changing the name" so I just got the script to how it was before, any ideas?
function Click() if player.team.teamcolor == BrickColor.Red and script.Parent.Mousebutton1Click then script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-13.2, 0.5, -35.27) end end if script.Parent.MouseButton1Click:connect(Click) and player.team == BrickColor.Blue then script.Parent.Parent.Parent.Parent.Character.HumanoidRootPart.CFrame = CFrame.new(-13.2, 0.5, -35.27) end end script.Parent.MouseButton1Down:connect(Click)
FindFirstChild
, the first letter in each word is uppercase).-- use variables, so you don't have to access something using 50938 .Parent 's local player = game:GetService("Players").LocalPlayer local function Click() if player.TeamColor == BrickColor.Red() then player.Character.HumanoidRootPart.CFrame = CFrame.new(-13.2, 0.5, -35.27) end if player.TeamColor == BrickColor.Blue() then . player.Character.HumanoidRootPart.CFrame = CFrame.new(-13.2, 0.5, -35.27) end end script.Parent.MouseButton1Click:Connect(Click)
end
for every if
, while
, for
, and function
.The error you have means that you have an extra 'end' in your script for example from line 9 to 11 you have 2 ends for only 1 if statement.
Also if you take a look at first 11 lines you'll see you have a function(which you have to end) and 2 if statements(both need to have an end) which means you need 3 ends but you have 4.
I also see you didn't post full code but in first 11 lines you definitely have an extra end. Obvious fix is go through your code and remove 1 end