Im_King
|
  |
| Joined: 14 May 2010 |
| Total Posts: 2352 |
|
|
| 23 Apr 2016 05:42 PM |
Then do -
How would you do that?
The script wouldn't be in the vehicle seat but in the same model
Add 25K posts |
|
|
| Report Abuse |
|
|
joji1000
|
  |
| Joined: 23 Aug 2013 |
| Total Posts: 291 |
|
|
| 23 Apr 2016 05:48 PM |
get the player from the vehicle seat under the property of 'Occupant' a way to do this would be to use Player = game.Players:FindFirstChild(script.Parent.Seat.Occupant) then you can detect if the player pressed a button Player:GetMouse().KeyDown:connect(function(Key) if Key == 'e' then --put what ever action you want end end) |
|
|
| Report Abuse |
|
|
Im_King
|
  |
| Joined: 14 May 2010 |
| Total Posts: 2352 |
|
|
| 23 Apr 2016 05:58 PM |
That didnt work
Player = game.Players:FindFirstChild(script.Parent.Seat.Occupant) Player:GetMouse().KeyDown:connect(function(Key) if Key == 'e' then script.Parent.RR.Motor.DesiredAngle = 0.3 script.Parent.RR.Motor.MaxVelocity = 0.005 end end)
Add 25K posts |
|
|
| Report Abuse |
|
|
Im_King
|
  |
| Joined: 14 May 2010 |
| Total Posts: 2352 |
|
| |
|
Im_King
|
  |
| Joined: 14 May 2010 |
| Total Posts: 2352 |
|
| |
|
unroot
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 1114 |
|
|
| 23 Apr 2016 07:02 PM |
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:connect(function(Input, GPE) if Input.UserInputType == Enum.UserInputType.Keyboard then if Input.KeyCode == Enum.KeyCode.E then print("e was pressed") end end end)
#code print("yolo" .. string.rep("o", math.huge)) |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2016 07:04 PM |
do the occupant thing
BUT
for the keydown do this
Mouse = game.Players.LocalPlayer
--Occupant thing function onKeyDown(key) key = key:lower() -- you need dis peeps if key == "e" then -blah blah blah end
Mouse.KeyDown:connect(key) |
|
|
| Report Abuse |
|
|
unroot
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 1114 |
|
|
| 23 Apr 2016 07:07 PM |
KeyDown is deprecated, use UserInputService or ContextActionService.
#code print("yolo" .. string.rep("o", math.huge)) |
|
|
| Report Abuse |
|
|