local TelePos = '-31, 34.5, -103.5' local Part = game.Workspace.Part12 if Part.BrickColor == "Navy Blue" then wait(2) Part.Position = (TelePos) end
No errors, the local script is in the part.
Wha I am trying to do: If the part is Navy blue than it teleports to the position in TelePos.
Not sure why this is not working any help would be appreciated
As you said, the LocalScript
is inside the Part. If the part is in workspace
, the LocalScript won't run, place somewhere that is listed in here.
https://developer.roblox.com/en-us/api-reference/class/LocalScript
Second, to update positions, you need to use Vector3.new(). Your code should be
local TelePos = Vector3.new(-31, 34.5, -103.5)
Lastly, to check brickcolors, you need to use BrickColor.new(). Your code should be
if Part.BrickColor == BrickColor.new("Navy blue") then