1 | local TelePos = '-31, 34.5, -103.5' |
2 | local Part = game.Workspace.Part 12 |
3 |
4 | if Part.BrickColor = = "Navy Blue" then |
5 | wait( 2 ) |
6 | Part.Position = (TelePos) |
7 | 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
1 | local TelePos = Vector 3. new(- 31 , 34.5 , - 103.5 ) |
Lastly, to check brickcolors, you need to use BrickColor.new(). Your code should be
1 | if Part.BrickColor = = BrickColor.new( "Navy blue" ) then |