NuselKaie
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 939 |
|
|
| 15 Nov 2013 11:06 AM |
| How can I access the Player Mouse & KeyDown, etc without a tool/hopperbin? |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2013 11:07 AM |
LocalScript, use the :GetMouse() event:
local p = game.Players.LocalPlayer local mouse = p:GetMouse()
Then you can use it as normal such as
mouse.KeyDown:connect(function(key) end) |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 15 Nov 2013 11:09 AM |
@Yoshi, ':GetMouse()' is a method, not an event.
Just thought I'd point that out. |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2013 11:10 AM |
| Sorry, I get confused.. My Apoligies. |
|
|
| Report Abuse |
|
|
NuselKaie
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 939 |
|
| |
|
NuselKaie
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 939 |
|
|
| 15 Nov 2013 02:39 PM |
| So, this doesn't need to be parented to the player? |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2013 02:40 PM |
--This would go in the starterpack. Player = script.Parent.Parent --Get the player. Tool = Instance.new("Tool") --Create a tool. Handle = Instance.new("Part",Tool) --Make a handle part so it will equip. Handle.Name = "Handle" --Make sure it's called handle, or it won't work. Tool.Equipped:connect(function(mouse) --When it's equipped fire a function. Tool.Parent = nil --Delete the tool so they don't see anything. mouse.KeyDown:connect(function(key) --When they press a key fire a function. print(key) --Print the key they pressed. end) --End the key function. end) --End the equip function. Tool.Parent = Player.Character --Parent it to the their character AFTER we have the equipped function ready so it will fire.
http://wiki.roblox.com/index.php/Equipped_(Event)
:P
|
|
|
| Report Abuse |
|
|
| |
|
NuselKaie
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 939 |
|
| |
|
| |
|
|
| 15 Nov 2013 03:07 PM |
That came from the roblox wiki so... Ignore the Roblox Wiki :P |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 15 Nov 2013 03:09 PM |
| u dont actually need a handle to make a tool. that is just if u want the tool to look a specific way. obsessed, dont copy from the wiki. post the link to that part of the wiki |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Nov 2013 03:16 PM |
| Those lines at the bottom????? Maybe :P |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
| |
|