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

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

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

0
Doesn't work, no output appears.:( iluvmaths1123 198 — 9y
Ad

Answer this question