Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my part not teleport if the part is navy blue? No errors

Asked by 3 years ago


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

0
Try my answer again. NotTheChara 191 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

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
0
did you mean to add 3 at the end of "BrickColor"? rookiecookie153 53 — 3y
0
stilll doesnt work I did everything you said (did not use the 3 at end of brickcolor) DevSeveral 19 — 3y
0
Use "Navy blue", not "Navy Blue". Necro_las 412 — 3y
0
Uh yes, use Navy blue. NotTheChara 191 — 3y
Ad

Answer this question