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:
game.StarterGui:SetCoreGuiEnabled(4, false)
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
Size = script.Parent.AbsoluteWindowSize
Rsize = Size/4
Mouse.KeyDown:connect(function(key)
if key == "e" then
for Scroll = 1,5 do
script.Parent.CanvasPosition = script.Parent.CanvasPosition +Vector2.new(Rsize, 0)
end
if script.Parent.SelectedTool.Value ~= 4 then
script.Parent.SelectedTool.Value = script.Parent.SelectedTool.Value +1
end
end
end)
Mouse.KeyDown:connect(function(key)
if key == "q" then
for Scroll = 1,5 do
script.Parent.CanvasPosition = script.Parent.CanvasPosition -Vector2.new(Rsize, 0)
end
if script.Parent.SelectedTool.Value ~= 1 then
script.Parent.SelectedTool.Value = script.Parent.SelectedTool.Value -1
end
end
end)

2 comments
You misunderstood. I need the position of the frame to move when someone hits a key. I need a way to do that.
well look on this page to help you :)