mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 07:13 AM |
Okay, don't judge me, I'm new to this stuff. Is there any way to make a script in where the player cannot be backwards (head first)? I'm making a game where you free fall out of a tower, land in water and fight. But when the person free-falls out of the tower, the person always lands headfirst on the lake's floor, and the player can't swim (he's stuck backwards)
Is it possible to make a script like that/is there one? |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:30 AM |
http://wiki.roblox.com/index.php/Bodygyro instance a bodygyro in the player's torso and set maxTorque to Vector3.new(math.huge,0,math.huge) |
|
|
| Report Abuse |
|
|
jnickib
|
  |
| Joined: 28 May 2012 |
| Total Posts: 137 |
|
|
| 13 Oct 2013 07:34 AM |
math.huge is not a number.
Use 1e999, it is the same thing, and it DOES equal up to infinity (also known as math.huge)
|
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 07:37 AM |
Again, I'm new, so I have no idea what a bodygyro is.
Do I put in " local b = Instance.new('BodyGyro') b.maxTorque = Vector3.new(math.huge,0,math.huge) b.cframe = CFrame.new(0, 10, 0) b.Parent = Workspace.Part
or...
actualy am dolan |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:44 AM |
| that would work but there's no need to set the cframe if you just want the brick to not tip over |
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 07:48 AM |
With the vector3 and all, I put :
Workspace.(what do I put here?).Position = Vector3.new(0, 50, 0) local b = Instance.new('BodyGyro') b.maxTorque = Vector3.new(math.huge,0,math.huge) b.Parent = Workspace.(what do I put here)
am I missing something?
actualy am dolan |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:53 AM |
the first line would just move a brick to 0,50,0, just put whatever you need to move in between workspace and position
as for the fourth line, the parent of b should be the brick that you want to keep from tipping over |
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 07:54 AM |
wait, Torso isn't in workspace how do you get a torso to workspace?
actualy am dolan |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:59 AM |
use the Parent property to change the hierarchy of objects ex: workspace.Player.Torso.Parent = workspace
however that's not necessary if you just want to put a bodygyro inside the player's character just use the path of the torso when changing the parent property of bodygyro or instancing bodygyro ex: Instance.new("BodyGyro",workspace.Player.Torso) |
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 08:06 AM |
So the final script is :
1: Instance.new("BodyGyro",workspace.Player.Torso) 2: workspace.Player.Torso.Parent = workspace 3: Workspace.Torso.Position = Vector3.new(0, 50, 0) 4: local b = Instance.new('BodyGyro') 5: b.maxTorque = Vector3.new(math.huge,0,math.huge) 6L b.Parent = Workspace.Torso
actualy am dolan |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 08:09 AM |
you don't need the second line, the second line would kill the player
also, the third line would kill the player if you want to teleport the player to 0,50,0, use this instead: Workspace.Torso.CFrame = CFrame.new(0, 50, 0)
another thing to note is that this script will only run once, and will only run if a player named "Player" is in the server before it runs
if you want the script to work for all players, you'll have to do some extra stuff |
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 08:10 AM |
Oh, and do you add "Player" and "Torso" like :
Instance.new("Torso",workspace.Player) Instance.new("Player",workspace)
actualy am dolan |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 08:11 AM |
| "Torso" isn't a valid instance and "Player" cannot be instanced |
|
|
| Report Abuse |
|
|
mocol
|
  |
| Joined: 17 Aug 2007 |
| Total Posts: 312 |
|
|
| 13 Oct 2013 08:11 AM |
Oh, I need everyone in the server to be affected by this. This will be way too hard, I'm just gonna think of another idea for a game.
actualy am dolan |
|
|
| Report Abuse |
|
|