|
| 16 Oct 2013 05:52 PM |
local b = Model.findFirstChild("S")
function onTouched()
b.CFrame = Vector3.new(0, 5, 0) wait(5) b.Cframe = Vector3.new(0,5,0) end
script.Parent.Touched:connect(onTouched)
I want to move a block by stepping on another block.
why isn't this working?
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 16 Oct 2013 06:14 PM |
local b = Model.findFirstChild("S")
function onTouched() if b then -- check if "b" is really there. Can prevent errors. b.CFrame = b.CFrame + Vector3.new(0, 5, 0) wait(5) b.Cframe = b.CFrame + Vector3.new(0, 5,0) end end script.Parent.Touched:connect(onTouched)
You can't construct a CFrame using Vector3. You can do operations with it, though. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 06:15 PM |
local b = script.Parent.Parent:FindFirstChild("S")
function onTouch()
b.CFrame = Vector3.new(0, 5, 0) wait(5) b.Cframe = Vector3.new(0,5,0) end
script.Parent.Touched:connect(onTouch)
This still won't work, hopingly it would;ve
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 06:17 PM |
Thanks so much.
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 16 Oct 2013 06:17 PM |
local b = script.Parent.Parent:FindFirstChild("S")
function onTouched() if b then -- check if "b" is really there. Can prevent errors. b.CFrame = b.CFrame + Vector3.new(0, 5, 0) wait(5) b.Cframe = b.CFrame + Vector3.new(0, 5,0) end end
script.Parent.Touched:connect(onTouched)
I suppose you can try this, too. |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
| |
|
|
| 16 Oct 2013 06:27 PM |
local b = script.Parent.Parent:FindFirstChild("S")
function onTouched() if b then
b.CFrame = b.CFrame + Vector3.new(0,-5, 0)
script.Disable = true
wait(1)
script.Disable = false
b.Cframe = b.CFrame + Vector3.new(0,5,0)
end end script.Parent.Touched:connect(onTouched)
I was actually going for this, sorry, I didn't want the player to spam the button.
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 06:28 PM |
But then again, this doesn't bring the block back up.
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 16 Oct 2013 06:47 PM |
b.CFrame = b.CFrame + Vector3.new(0, 5, 0) wait(5) b.Cframe = b.CFrame + Vector3.new(0, -5,0) |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 06:49 PM |
thanks, it works now.
Interior Crocodile Alligator |
|
|
| Report Abuse |
|
|