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

Text Button to unanchor an object?

So I wanted to make a text button to unanchor dice for a dice game. I have scripted something but it's not working.

local Dice1 = game.Workspace.Dices.Dice1 local Dice2 = game.Workspace.Dices.Dice2

script.Parent.MouseButton1Click:Connect (function() Dice1.Anchored = false

   Wait(0.5)

   Dice2.Anchored = false

End)

3 answers

✓ Accepted answer

I think your script is a bit wrong: at line before 1, there is a space between :Connect and (function() and at the end

So i think my script would work (if not, tell me. I'm still noob :v)

local Dice1 = game.Workspace.Dices.Dice1
local Dice2 = game.Workspace.Dices.Dice2

script.Parent.MouseButton1Click:Connect(function()
Dice1.Anchored = false
wait(0.5)
Dice2.Anchored = false
end)

I don't know if this is the problem but maybe turn End) into end) (no caps).

1 comment

0

and do Wait(0.5) into wait(0.5)

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