Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

{Mouse wheel/Value script} Not working?

The point of this script is to make the value go up 1 if they scroll forward and go down 1 if they scroll backward, but nothing happens, no errors, and clues?

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.WheelForward:connect(function()
	script.Parent.val.Value = script.Parent.val.Value +1
end)

Mouse.WheelBackward:connect(function()
	script.Parent.val.Value = script.Parent.val.Value -1
end)


8 comments

0

Maybe its your wheel cause nothing looks wrong?

0

it works fine if i replace 5 and 9 with print "Scroll" so its not my wheel

0

Whats the val? Is it string or number

0

number

0

Are you sure your testing this in Studio? This will error in play mode due to not waiting until the player fully loads..

0

No it wont, there are no variables. It just calls mouse which is loaded the same i think.

0

Is this in a localscript? Sorry if I sound stupid.

0

It is.

1 answer

✓ Accepted answer

if you go into the object browser of roblox studio and look for mouse then go down to mousewheel it says that its non operational so trying to dothis wont work

This discussion is preserved as it was. New answers, comments, and votes are closed.