yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 21 Feb 2015 07:19 AM |
I made this to connect my function and it says it's a nil value.
mouse.KeyDown:connect(FireWall)
|
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 21 Feb 2015 07:37 AM |
update notes: Added deprecated tag to Event Mouse.KeyDown Added deprecated tag to Event Mouse.KeyUp move to UIS
AND THE TIGER GOES ROAR |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 21 Feb 2015 07:40 AM |
"Did you define the mouse?"
I didn't know I had to. How do I do it? |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 21 Feb 2015 07:41 AM |
before you ask UIS is userinputservice wiki it to win it
AND THE TIGER GOES ROAR |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 21 Feb 2015 07:41 AM |
(sorry for double post) in local scripts you can just do local mouse = game.Players.LocalPlayer:GetMouse()
AND THE TIGER GOES ROAR |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2015 08:10 AM |
http://wiki.roblox.com/index.php?title=Mouse
Define Mouse:
Inside LocalScript
Player = game.Players.LocalPlayer Mouse = Player:GetMouse()
function FireWall()
end
Mouse.KeyDown:connect(FireWall)
"I like to program." - Bosswalrus |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 21 Feb 2015 08:24 AM |
| Why can't you put it in a server script? |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2015 09:09 AM |
Because this line
Player = game.Players.LocalPlayer
Would return nil.
"I like to program." - Bosswalrus |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 21 Feb 2015 05:39 PM |
"Player = game.Players.LocalPlayer"
Cant I just use script.Parent.Parent:GetPlayerFromCharacter().Parent ? |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 21 Feb 2015 05:45 PM |
Im using this in play solo:
mouse = script.Parent.Parent.Parent:GetMouse() --code mouse.KeyDown:connect(functionname)
And it doesn't work. It doesn't give an output either. I prefer not to use local scripts because I don't know what I have to change when I use them. |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
| |
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 21 Feb 2015 07:53 PM |
:GetMouse() can only be obtained in a localscript
AND THE TIGER GOES ROAR |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 22 Feb 2015 08:01 AM |
| Is there a way to do it without using a local script? I really have no idea how to use them. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 22 Feb 2015 08:04 AM |
| you couldn't really get a local player's mouse with a server script.. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 22 Feb 2015 08:05 AM |
| if it helps you understand local scripts slightly better, they only run inside of the player, or if they are ran inside of the character. (descendants of players only i think) |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 22 Feb 2015 08:44 AM |
| Theres no other way to tell if someone presses a button besides a local script? And I was wondering what I would need to change in my code in a local script compared to a regular script. |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
| |
|
|
| 22 Feb 2015 12:38 PM |
| Use a RemoteEvent for this sort of stuff. |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 22 Feb 2015 12:40 PM |
| What is a remote event and how do I use it? |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 12:41 PM |
Mouse.ButtonDown1
Wouldn’t that be what you need to use? |
|
|
| Report Abuse |
|
|
yoshiegg6
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 22 Feb 2015 12:44 PM |
| That's for clicking and its mousebutton1down.clicked. This is for when someone Presses a button. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Feb 2015 12:46 PM |
mousebutton1down.clicked? no
its MouseButton1Down
MouseButton1Up
MouseButton1Click |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 12:52 PM |
| It's impossible to access the player's mouse from a server script. |
|
|
| Report Abuse |
|
|