#Tweens are running but only actually work sometimes...

76 messages · Page 1 of 1 (latest)

vocal pecan
#
function visuals.move_tile (tile, goal, mode)
    local Ay,Ax = visuals.get_coords(goal)
    local By,Bx = visuals.get_coords(tile)
    local player = game.Players.LocalPlayer
    local frame = player.PlayerGui.Board.Frame
    local Visual_Folder = frame.Tiles_VISUAL
    local GridLayout = Button_Folder:WaitForChild("GridLayout")
    local Agoal = {}
    local Bgoal = {}
    Agoal.Position = UDim2.new(GridLayout.CellSize.X.Scale * (Ax-1),0,GridLayout.CellSize.Y.Scale * (Ay-1),0)
    Bgoal.Position = UDim2.new(GridLayout.CellSize.X.Scale * (Bx-1),0,GridLayout.CellSize.Y.Scale * (By-1),0)
    warn("Moved")
    coroutine.wrap(function()
        local move_tween = TS:Create(Visual_Folder:WaitForChild(tile), move_tween_info, Agoal)
        move_tween:Play()
        Visual_Folder[tile].Name = goal
    end)()
    if mode == "Swap" then
        warn("Swapped")
        coroutine.wrap(function()
            local move_tween = TS:Create(Visual_Folder:WaitForChild(goal), move_tween_info, Bgoal)
            move_tween:Play()
            Visual_Folder[goal].Name = tile
            move_tween.Completed:Connect(function()
                print('Swap completed')
            end)
        end)()
    end
    print(Visual_Folder[tile].Name)
    print(Visual_Folder[goal].Name)
end

The names of the tiles print correctly, it feels like its some certain tiles that dont swap. It's not anything with tweens being interrupted due to swapping too fast, I can wait forever before swapping two tiles and nothing changes.

Also, if I try to swap tile A to tile B, it may not do anything. But if I instead do tile B to tile A, it does swap. Then I can swap them back and forth but never from A to B.

My laptop is about to die, someone please save me.

charred jewel
#

pee pee poo poo

#

ill help you when i get on my mc

#

pc*

#

in 3 hours

vocal pecan
#

w

#

thank you ayoon2

charred jewel
#

no problem fartmiser

#

u been s1 for 2 years

#

😔

vocal pecan
#

This game will make me s2

#

Its gotta

charred jewel
#

ok im on pc

#

this scripts too complex for me 😔

vocal pecan
#

😒

charred jewel
#

print tween idk

vocal pecan
#

Aight 💀

#

Basically it takes the names of two things, converts them to X and Y coordinates on a grid, converts X and Y to scale, then swaps the positions of those two things

#

fire video of it

#

I can swap the green tile to the yellow tile, but not the yellow tile to the green

#

it seems like only some tiles can be the first tile clicked

#

it looks like I cant swap up or right

#

unless I go left then right, or down then up on the same two tiles

charred jewel
#

mf fr made candy crush

vocal pecan
#

🤫

#

I havent shown any gameplay cuz there arent any match 3 games and any scripter with an ounce of knowledge could do this faster than me

#

but yea

charred jewel
#

also stop snake case

vocal pecan
#

hmm?

#

oh

vocal pecan
#

its_not_that_bad

#

ima print the goal and see if it's right

#

goals*

#

the output is right

#

its just not moving

#

(on a right swap)

#

the first tile (left) should be moving to a greater x position than the second tile (right) is

charred jewel
vocal pecan
#

I stg sometimes I dont have bugs, I have anomalies

#

bruh

charred jewel
vocal pecan
#

ill try the column slot to the second

#

should be the most clear

vocal pecan
#

im sure (it's y,x not x,y because lua)

#

they did not swap

#

they just stay there

#

and the tween.completed runs

#

lemme check the actual positions in the gui

charred jewel
#

why dont you make

#

like

#

the 2 tween

#

in the same thread idk

vocal pecan
#

sometimes the tile will be dropping, not swapping with another tile

#

so

#

im lazy

#

essentially

#

I gotta go to chemistry

#

thanks for your time

charred jewel
#

😔

#

sorry for not helping

vocal pecan
#

Oh

#

Ok im just a dumbass

#

💀

#

K it works now

#

God damn im dumb

#

Its because I changed the name

charred jewel
rich topaz
#

mark this as solved

vocal pecan
#

I thought I did