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

How to make TextButton that will unanchor a part?

Asked by 4 years ago
Edited 4 years ago

I want to make TextButton that will unanchor my part, but when I click on the gui my part is still anchored. Nothing is showing up in output. I put LocalScript in TextButton at StarterGui. Here is the script:

local MainGui = script.Parent
local TextButton = MainGui.TextButton

TextButton.MouseButton1Up:Connect(function()
      game.Workspace.Dice1.Anchored=false
end)
0
What exactly is the issue? LikeToScript 108 — 4y
0
Try catching the error and editing your question. User#22889 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Hi, your script is correct.

There might be an issue where the dice is welded that's why it doesn't move at all.

local MainGui = script.Parent
local TextButton = MainGui.TextButton

TextButton.MouseButton1Up:Connect(function()
    game.Workspace.Dice1.Weld:Destroy()
    game.Workspace.Dice1.Anchored=false
end)
Ad

Answer this question