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 » Game Design
Home Search
 

Re: Tools with right click/key functions.

Previous Thread :: Next Thread 
SamTehBoss is not online. SamTehBoss
Joined: 23 Dec 2011
Total Posts: 11
11 Apr 2015 10:47 AM
Pretty self-explanatory. I've been trying to mess around with scripts like that, but they don't seem to work in-game. Trying to rip 'em off Roblox gears is also a real tough challenge. I'm well aware of the problems concerning right clicking and the such (camera shenanigans ect.), so what I would like is if someone could post a base of sorts for a script that lets you use a key (or right-clicking if by any chance someone manages to do that) to activate something.
Report Abuse
SamTehBoss is not online. SamTehBoss
Joined: 23 Dec 2011
Total Posts: 11
11 Apr 2015 10:58 AM
Edit: Whoops I think that's the wrong forum, the description misled me. Should I post it again in the Scripting Helpers or should I just leave it here.
Report Abuse
iHin is not online. iHin
Joined: 06 Apr 2014
Total Posts: 407
11 Apr 2015 11:03 AM
Player = game.Players.LocalPlayer
Mouse = Players:GetMouse()

Mouse.MouseButton1Down:connect(function(clicked)
--code
end)

Mouse.MouseButton2Down:connect(function(clicked)
--code
end)
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
11 Apr 2015 11:35 AM
iHin that wont work.

"Mouse = Players:GetMouse()"

You never set a local for Players, your basically grabbing a local out of mid-air.
Report Abuse
SamTehBoss is not online. SamTehBoss
Joined: 23 Dec 2011
Total Posts: 11
11 Apr 2015 11:41 AM
In the console I'm getting "MouseButton1Down is not a valid member of PlayerMouse". Ditto for MouseButton2Down.
Report Abuse
iHin is not online. iHin
Joined: 06 Apr 2014
Total Posts: 407
11 Apr 2015 11:43 AM
@Summer, no you can. I just gave the wrong events.

it's


Mouse.Button1Down
Mouse.Button2Dow

also change the "Player" and "Mouse" variables to local.


Sorry about that!
Report Abuse
iHin is not online. iHin
Joined: 06 Apr 2014
Total Posts: 407
11 Apr 2015 11:43 AM
Also I meant


"local Mouse = Player:GetMouse()"


@summer, once again... it's a typo. You don't know what you're saying :c
Report Abuse
SamTehBoss is not online. SamTehBoss
Joined: 23 Dec 2011
Total Posts: 11
11 Apr 2015 12:03 PM
I'm afraid this goes back to the problem I had: While it works wonders in Studio, I can't make it work ingame.
"attempt to index local 'Players' (a nil value)"
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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