|
| 24 Dec 2012 12:44 PM |
How would I acces the mouse through a seat that a character is sitting in?
Lets assume I already have the player, what would I do? |
|
|
| Report Abuse |
|
|
miniTeam
|
  |
| Joined: 28 Oct 2012 |
| Total Posts: 27 |
|
|
| 24 Dec 2012 12:46 PM |
| Many things, but you won't do them. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2012 12:49 PM |
| I will do them, now tell me please. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
| |
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 24 Dec 2012 01:10 PM |
mouse = player:GetMouse()
mouse.KeyDown:connect(function(k) key = string.lower(k) if key == "r" then player.Character.Humanoid:TakeDamage(player.Character.Humanoid.MaxHealth) end end)
-- Reset Key :P |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 24 Dec 2012 02:02 PM |
mouse.KeyDown:connect(function(key) key = key:lower() if key == "r" then --do stuff here elseif key == "g" then --do more stuff here, if you only want one key, then delete this line and the elseif line end end) |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 24 Dec 2012 02:03 PM |
| use the variable definition from the post above my last. |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 24 Dec 2012 02:07 PM |
:3
He said a seat he is sitting on..
put this in seat..
script.Parent.Touched:connect(function (hit) if hit.Parent:findFirstChild("Humanoid") then x = game.Players:GetPlayerFromCharacter(hit.Parent) mouse = x:GetMouse() mouse.KeyDown:connect(function (key) if key:lower() == "r" then x:LoadCharacter() end end) end)
script.Parent.TouchEnded:connect(function () break end) |
|
|
| Report Abuse |
|
|