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

How do I fix this broken script where a mesh unanchors, turns visible, and falls on you?

Asked by
frauad 0
2 years ago

I have just recently learned how to script and I'm having trouble figuring out what is wrong with this script

              Here is the script
local hi = script.Parent

hi.ClickDetector.MouseClick:Connect(function()
    game.ReplicatedStorage.a.Anchored = false
    game.ReplicatedStorage.a.Transparency = 0
end)

Thank you in advance!

1 answer

Log in to vote
1
Answered by 2 years ago

Nothing is wrong with this script, yet this question lacks details, we really can't help you with the amount of information you give us, like, what IS exactly "not working"?

The only thing that seems ODD is that, the supposed mesh that is falling on the player, which is called "a", is located in "game.ReplicatedStorage", If you want your part to show on the map it must be located in the Workspace, so maybe try this?

local hi = script.Parent

hi.ClickDetector.MouseClick:Connect(function()
    local mesh = game.ReplicatedStorage.a
    mesh.Parent = game.Workspace
    mesh.Anchored = false
    mesh.Transparency = 0
end)

If that isn't the problem tho, we will need more information to actually be able to help you.

Ad

Answer this question