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

Why isn't this tweening working..?

Asked by 8 years ago

trying so when they touch a block this gui does preeeetttyyy stuff

local debounce = true
local plr = game.Players.LocalPlayer
print(debounce)

game.Workspace.TouchMe.Touched:connect(function()
    if debounce == true then
        script.Parent.Background.Frame:TweenPosition(UDim2.new(0, 310, 0, 0) 'Out', 'Linear', 0.35)
        wait(0.2)
        script.Parent.Background.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), 'In', 'Linear', 0.35)
        wait(0.2)
        script.Parent.Background.Frame:TweenSize(UDim2.new(1, 0, 1, 0), 'Out', 'Linerar', 0.5)
    end
    debounce = false
    print(debounce)
end)

error

15:07:27.409 - Workspace.Gui.SurfaceGui.Manager:7: attempt to call a userdata value

i feel like a noob

0
Is this in a Script inside the GUI? And is FilteringEnabled on? TinyPanda273 110 — 8y
0
inside the surface gui. and no DeveloperSolo 370 — 8y
0
So, it's a local script, inside an object in workspace? TinyPanda273 110 — 8y
0
yes. [just realises how thats wrong] qqqqqq why do i keep forgetting simple things DeveloperSolo 370 — 8y

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

You forgot a comma between UDim2.new() and 'Out' on line 7. Also, 'Linear' is misspelled on line 11.

local debounce = true
local plr = game.Players.LocalPlayer
print(debounce)

game.Workspace.TouchMe.Touched:connect(function()
    if debounce == true then
        script.Parent.Background.Frame:TweenPosition(UDim2.new(0, 310, 0, 0), 'Out', 'Linear', 0.35)
        wait(0.2)
        script.Parent.Background.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), 'In', 'Linear', 0.35)
        wait(0.2)
        script.Parent.Background.Frame:TweenSize(UDim2.new(1, 0, 1, 0), 'Out', 'Linear', 0.5)
    end
    debounce = false
    print(debounce)
end)

Hope this helped.

Ad

Answer this question