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

Why isn't this tweening working..?

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

4 comments

0

Is this in a Script inside the GUI? And is FilteringEnabled on?

0

inside the surface gui. and no

0

So, it's a local script, inside an object in workspace?

0

yes. [just realises how thats wrong] qqqqqq why do i keep forgetting simple things

1 answer

✓ Accepted answer

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.

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