PvN
|
  |
| Joined: 10 Apr 2010 |
| Total Posts: 22145 |
|
|
| 27 May 2015 08:41 PM |
MouseWheelForward doesnt return anything and neither does UserInputService
is there a way to detect scrolling? cant find many threads talking about it |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:44 PM |
local UIS = game:GetService("UserInputService")
function mouseScrolled(inputObject, gameProcessedEvent) if inputObject.UserInputType == Enum.UserInputType.MouseWheel then if inputObject.Position == 1 then -- moved forward elseif inputObject.Position == -1 then -- moved backward else -- didn't move end end end
UIS.InputChanged:connect(mouseScrolled) |
|
|
| Report Abuse |
|
|
oofive2
|
  |
| Joined: 08 May 2011 |
| Total Posts: 1608 |
|
|
| 27 May 2015 08:45 PM |
script.Parent.MouseButton1Click:connect(function() --code end)
You can make it so when they click on the frame it will act up if you want.
-/I can't drown my demons they know how to swim\- |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:45 PM |
^ that's defiantly the same thing as scrolling. |
|
|
| Report Abuse |
|
|
oofive2
|
  |
| Joined: 08 May 2011 |
| Total Posts: 1608 |
|
|
| 27 May 2015 08:45 PM |
You can also make an invisible frame near the scroll bar that does nothing besides make a plant for the click c:. No need to be complicated when you can be creative :D.
-/I can't drown my demons they know how to swim\- |
|
|
| Report Abuse |
|
|
oofive2
|
  |
| Joined: 08 May 2011 |
| Total Posts: 1608 |
|
|
| 27 May 2015 08:46 PM |
nQ dont hate that im more creative than you c:.
-/I can't drown my demons they know how to swim\- |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:46 PM |
^ that is complicated. the way I posted is extremely simple. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 27 May 2015 08:49 PM |
"else -- didn't move"
Hopefully that code never runs. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:50 PM |
| That would be pretty scary. |
|
|
| Report Abuse |
|
|
PvN
|
  |
| Joined: 10 Apr 2010 |
| Total Posts: 22145 |
|
|
| 27 May 2015 08:52 PM |
have you used that before? it doesnt work
local UIS = game:GetService("UserInputService")
function mouseScrolled(inputObject, gameProcessedEvent) if inputObject.UserInputType == Enum.UserInputType.MouseWheel then if inputObject.Position == 1 then print("moved forward") elseif inputObject.Position == -1 then print("moved backward") else print("didn't move") end end end
UIS.InputChanged:connect(mouseScrolled)
oh well i just wont bother |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:54 PM |
Sorry, I was wrong :(
local UIS = game:GetService("UserInputService")
function mouseScrolled(inputObject, gameProcessedEvent) if inputObject.UserInputType == Enum.UserInputType.MouseWheel then if inputObject.Position.Z > 0 then -- moved forward else -- moved backward end end end
UIS.InputChanged:connect(mouseScrolled)
Also, the Z position should indicate how much the player scrolled, and I don't know what the other components of the vector3 represent. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 27 May 2015 08:57 PM |
| are you able to define a specific player with UIS? |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 08:58 PM |
| UserInputService is local. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 27 May 2015 09:15 PM |
| The first two components of the Position Vector3 correspond to the mouse's position on the screen. |
|
|
| Report Abuse |
|
|