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

Text Button to unanchor an object?

Asked by 5 years ago

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

1Wait(0.5)
2 
3Dice2.Anchored = false

End)

3 answers

Log in to vote
0
Answered by 5 years ago

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)

1local Dice1 = game.Workspace.Dices.Dice1
2local Dice2 = game.Workspace.Dices.Dice2
3 
4script.Parent.MouseButton1Click:Connect(function()
5Dice1.Anchored = false
6wait(0.5)
7Dice2.Anchored = false
8end)
Ad
Log in to vote
0
Answered by 5 years ago

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

0
and do Wait(0.5) into wait(0.5) User#29913 36 — 5y
Log in to vote
0
Answered by 5 years ago

Ok I am about to try that

Answer this question