koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 06 Jun 2012 03:08 PM |
Does anyone know a way to prevent a player get out of a seat? I want that the player is stuck in a vehicle seat. Does anyone know how to do this? My apoligies for my bad english. Thanks for reading, hope we will find out.
sincerely, Koenman |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 06 Jun 2012 03:14 PM |
| Use the seated event, then anchor their torso. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 06 Jun 2012 03:33 PM |
| But then the player wont be able the vehicle isn't it? |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2012 03:48 PM |
You make be able to weld their torso to the seat.
~Read Between The Squiggles~ |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 06 Jun 2012 04:04 PM |
Instead, just put a kill brick above their head so if they jump out, they die. :D Just kidding, don't do that. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|
|
| 06 Jun 2012 04:39 PM |
| use the seated event to weld their legs to the chair |
|
|
| Report Abuse |
|
|
CrasyTrex
|
  |
| Joined: 13 Mar 2011 |
| Total Posts: 761 |
|
|
| 06 Jun 2012 04:47 PM |
Or mabye make it so they can't jump? script.Parent.Touched:connect(function (hit) if hit and hit.Parent then if game.Players:FindFirstChild(hit.Parent.Name) then if hit.Parent.Humanoid.Health ~= 100 then repeat hit.Parent.Humanoid.Jump = false until hit.Parent.Humanoid.Health = 0 end end end end)
|
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 07 Jun 2012 07:33 AM |
Sure.
This one breaks your character, and then breaks itself, making for some humourous results!
seat = script.Parent
seat.ChildAdded:connect(function(c) if c.ClassName == "Weld" then local h = c.Part1 local w = Instance.new("Weld", seat) w.Part0 = seat w.Part1 = h.Parent.Head w.C0 = CFrame.new( Vector3.new(0,20,0) ) w.C1 = CFrame.new() end end)
Give me a sec and I'll go fix it xD |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 07 Jun 2012 07:51 AM |
NOPE it just got worse D:
seat = script.Parent
seat.ChildAdded:connect(function(c) if c.Name== "SeatWeld" then local h = c.Part1 local p = h.Parent.Head.Position - c.Part0.Position w = Instance.new("Weld", seat) w.Part0 = seat w.Part1 = h.Parent["Left Leg"] w.C0 = CFrame.new(p) w.C1 = CFrame.new() end end)
seat.ChildRemoved:connect(function(c) if w then w:Destroy() end end)
I've concluded welding doesn't help, be it the torso, head, or leg.
Actually I remember helping a guy out with the exact same problem last year...I'll be back in a tick
Here, catch this script.
seat = script.Parent allowedToJump = false
seat.ChildAdded:connect(function(c) if c.Name== "SeatWeld" then local h = c.Part1.Parent:FindFirstChild("Humanoid") repeat wait() h.Jump = false until allowedToJump end end)
It is pretty brutal in the sense that it resets the .Jump value on the player's humanoid to false every 0.03 of a second (or close to)
That's the only way I've been able to do it. Enjoy. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 08 Jun 2012 11:30 AM |
Unfortunately that didn't work :(. I think disableling jumping does not work. Maybe another way? |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 06:51 PM |
| When the torso to seat weld is removed (exiting seat) clone the weld and replace it. I'm not sure if that would work. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 09 Jun 2012 10:50 AM |
Tried to make something that does that. But it didn't work. Maybe one of you guys can fix it?
function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then player = child.Part1.Parent weld = child:clone() weld.Parent = script print("Weld was cloned.") end end end
function onChildRemoved() if player.Humanoid.Jump == true then player.Humanoid.sit = true replaceweld = weld:clone() replaceweld.Parent = script.Parent print("Human tried to leave the seat, Replacing human.") else print("Human escaped.") end end
script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)
|
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 09 Jun 2012 11:49 AM |
| Perhaps my ghetto idea was not so bad after all. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 09 Jun 2012 12:53 PM |
| xD. That won't be such a good idea. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 09 Jun 2012 01:05 PM |
| Wait I think I know. So inside the player humanoid there is a jump property. Just make a script that is activated when the local human sits in the chair, then it makes the property always = false no matter what. |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 09 Jun 2012 01:22 PM |
| Already tryed that, it doesn't work. |
|
|
| Report Abuse |
|
|
| |
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 09 Jun 2012 01:53 PM |
| But if i do that, will you still be able to drive a vehicle without using a tool? |
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
|
| 09 Jun 2012 01:59 PM |
function onChildAdded(child) if child.Name == "SeatWeld" then if child.Part1.Name == "Torso" then player = child.Part1.Parent weld = child:clone() print("Weld was cloned.") end end end
function onChildRemoved() if player ~= nil then if player.Humanoid.Jump == true then player.Humanoid.Sit = true replaceweld = weld:clone() replaceweld.Parent = script.Parent print("Human tried to leave the seat, Replacing human.") else print("Human escaped.") end end end
script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved) ________________________________________________________ Didn't work either - Workspace.Car.Sear.Script:15: attempt to index global 'weld' (a nil value)
|
|
|
| Report Abuse |
|
|
koenman
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 108 |
|
| |
|