|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|