Why won't this scrolling frame scroll on KeyDown?
I am making something for a game, and for some reason, the script returns with no errors, but it does nothing. I have tried scrolling it all the way, finding the position, and scrolling it back. Nothing will work for me. It is supposed to be when you hit a button, it will scroll a 4th of the way in either direction, and change the tool value.
I have pictures here of what it looks like:
In game:
http://imgur.com/vWce8yc,8CUxw25
In the explorer:
http://imgur.com/vWce8yc,8CUxw25#1
Here is the code:
01 | game.StarterGui:SetCoreGuiEnabled( 4 , false ) |
02 | Player = game.Players.LocalPlayer |
03 | Mouse = Player:GetMouse() |
05 | Size = script.Parent.AbsoluteWindowSize |
08 | Mouse.KeyDown:connect( function (key) |
11 | script.Parent.CanvasPosition = script.Parent.CanvasPosition +Vector 2. new(Rsize, 0 ) |
13 | if script.Parent.SelectedTool.Value ~ = 4 then |
14 | script.Parent.SelectedTool.Value = script.Parent.SelectedTool.Value + 1 |
18 | Mouse.KeyDown:connect( function (key) |
21 | script.Parent.CanvasPosition = script.Parent.CanvasPosition -Vector 2. new(Rsize, 0 ) |
23 | if script.Parent.SelectedTool.Value ~ = 1 then |
24 | script.Parent.SelectedTool.Value = script.Parent.SelectedTool.Value - 1 |