generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: PlayerMouse

Previous Thread :: Next Thread 
NuselKaie is not online. 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
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
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 is not online. 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
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
15 Nov 2013 11:10 AM
Sorry, I get confused.. My Apoligies.
Report Abuse
NuselKaie is not online. NuselKaie
Joined: 24 Oct 2013
Total Posts: 939
15 Nov 2013 02:13 PM
Danke.
Report Abuse
NuselKaie is not online. 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
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
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
cheesetoasties is not online. cheesetoasties
Joined: 28 Oct 2013
Total Posts: 8878
15 Nov 2013 02:49 PM
ignore obsessed
Report Abuse
NuselKaie is not online. NuselKaie
Joined: 24 Oct 2013
Total Posts: 939
15 Nov 2013 02:49 PM
^ I figured that.
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
15 Nov 2013 03:06 PM
Well THANKS :P
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
15 Nov 2013 03:07 PM
That came from the roblox wiki so...
Ignore the Roblox Wiki :P
Report Abuse
domorox17 is not online. 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
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
15 Nov 2013 03:15 PM
I did :P
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
15 Nov 2013 03:16 PM
Those lines at the bottom????? Maybe :P
Report Abuse
domorox17 is not online. domorox17
Joined: 06 Mar 2012
Total Posts: 1710
15 Nov 2013 03:18 PM
lolz missed dat. srry bro
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image