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

Moving brick help?

Asked by 10 years ago

Ok, I changed my mind, I need it to be so when someone says "Left," it moves left by 1 or however many. It's only going to be one part, so that should be fairly easier. I have the script for doing a talk recognizing script:

door = script.Parent 

function onChatted(msg, recipient, speaker) 

local source = string.lower(speaker.Name) 
msg = string.lower(msg) 

if (msg == "left") then 
door.Position = PositionNew("") 
door.Transparency = 0.1
door.Transparency = 0.2
door.Transparency = 0.3
door.Transparency = 0.4
door.Transparency = 0.5
door.Transparency = 0.6
door.Transparency = 0.7
door.Transparency = 0.8
door.Transparency = 0.9
door.Transparency = 1
wait(3) 
door.Position = PositionNew("")
door.Transparency = 1
door.Transparency = 0.9
door.Transparency = 0.8
door.Transparency = 0.7
door.Transparency = 0.6
door.Transparency = 0.5
door.Transparency = 0.4
door.Transparency = 0.3
door.Transparency = 0.2
door.Transparency = 0.1
end 

end 

function onPlayerEntered(newPlayer) 
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) 
end 

game.Players.ChildAdded:connect(onPlayerEntered) 

0
Forgot to add wait in between the transparency changers. The wait is 0.1 jamesbiggsbot 0 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

door.Position = door.Position+Vector3.new("0,0,0") <--- Change one of the "0s" depending on the direction that you want to move it towards.

0
Thanks. jamesbiggsbot 0 — 10y
Ad

Answer this question