Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why is my tool script is non functional?

Asked by 10 years ago

Right now I am trying to get a test version done of it, but no errors are coming out, and the thing wont move the canvas position, plus the selectedtool value is not working. It is a number value btw. Thanks for all and any help. Does anyone know why?

01game.StarterGui:SetCoreGuiEnabled(4, false)
02Player = game.Players.LocalPlayer
03Mouse = Player:GetMouse()
04Mouse.KeyDown:connect(function(key)
05    if key == "e" and script.Parent.CanvasPosition ~= UDim2.new(1.5, 0) then
06        for i = 1,5 do
07        script.Parent.CanvasPosition = script.Parent.CanvasPosition +Vector2.new(0.01)
08        end
09        script.Parent.SelectedTool.Value =  script.Parent.SelectedTool.Value +1
10    end
11end)
12Mouse.KeyDown:connect(function(key)
13    if key == "q" and script.Parent.CanvasPosition ~= UDim2.new(0, 0) then
14        for i = 1,5 do
15        script.Parent.CanvasPosition = script.Parent.CanvasPosition -Vector2.new(0.01)
16        end
17        script.Parent.SelectedTool.Value =  script.Parent.SelectedTool.Value -1
18    end
19end)

Answer this question