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

How do i make a script so when the part is gone with a pickaxe a gui will show up?

Here is the script(IN LOCAL SCRIPT)

function Dissappear()
if Sparkerald == nil then -- Sparkerald is the name of the model
	print("Nil!")
	game:FindFirstChild("Sparkeraldgui" == game.StarterGui.Sparkeraldgui) --Sparkerald gui is the name of the gui
game.StarterGui.Sparkeraldgui.TextLabel.Visible = true --We can now do this scince we have activated the textlabel of sparkeraldgui
print("Visible!")
wait(3)
	game.StarterGui.Sparkeraldgui.TextLabel.Visible = false
   end
end
script.Parent.Destroyed:connect(Dissappear)
print("Connected!")

1 answer

Well, are you new to LUA? You've made some mistakes, but don't worry, they are easy to fix.

Try this code, if it doesn't work, tell me output.

-- remember to make a variable of Sparkerald
Sparkerald = game.Workspace:findFirstChild("Sparkerald")

function Dissappear()
if Sparkerald == nil then -- Sparkerald is the name of the model
    print("Nil!")
   -- replace Workspace with StarterGui if it's in StarterGui or whatever else.
    game.Workspace:FindFirstChild("Sparkeraldgui").Parent = game.StarterGui.Sparkeraldgui --Sparkerald gui is the name of the gui
game.StarterGui.Sparkeraldgui.TextLabel.Visible = true --We can now do this scince we have activated the textlabel of sparkeraldgui
print("Visible!")
wait(3)
    game.StarterGui.Sparkeraldgui.TextLabel.Visible = false
   end
end
script.Parent.Destroyed:connect(Dissappear)
print("Connected!")

Try this above ^ | Hope this helps! Thanks, marcoantoniosantos3

1 comment

0

Doesn't work, no output appears.:(

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