Tycooons
|
  |
| Joined: 13 Aug 2014 |
| Total Posts: 5871 |
|
|
| 18 Apr 2015 04:49 AM |
In my bowling game I am making, I have an invisible speed booster.
You have a tool that puts you inside a marble that you can roll in. The tool puts the marble (A single brick) inside the player's character called "Marble". How would I make it so when you touch the brick, you are boosted towards the direction the marble is facing. This is what I have so far, but it doesn't work:
part = script.Parent
function touched (hit) if hit.Parent:FindFirstChild("Humanoid") then local marble = hit.Parent:FindFirstChild("Marble") if marble then print(marble.Velocity) marble.Velocity = marble.CFrame.lookVector*300 end end end
part.Touched:connect(touched)
Umad bro? |
|
|
| Report Abuse |
|
|
Tycooons
|
  |
| Joined: 13 Aug 2014 |
| Total Posts: 5871 |
|
| |
|
Proxemics
|
  |
| Joined: 30 Oct 2013 |
| Total Posts: 2542 |
|
|
| 18 Apr 2015 05:13 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent:FindFirstChild("Marble") then local marble = hit.Parent.Marble print(marble.Velocity) marble.Velocity = marble.CFrame.lookVector * 300 end end end) |
|
|
| Report Abuse |
|
|
Tycooons
|
  |
| Joined: 13 Aug 2014 |
| Total Posts: 5871 |
|
|
| 18 Apr 2015 05:49 AM |
That script just pushes it to the right...,
|
|
|
| Report Abuse |
|
|
Tycooons
|
  |
| Joined: 13 Aug 2014 |
| Total Posts: 5871 |
|
| |
|