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

How do you delete a Instance?? I want to delete a hint when I am done w/ it....

Asked by 6 years ago
Edited 6 years ago

Basicly I wanna delete hint after done usin it, here is my code before destroying is.........................................................................................

H = Instance.new("Hint",workspace)
function Hint()
    if 
        game.Players.NumPlayers >1
        then
        H.Text = "If you cant get through the door its cause you are not the correct rank which is To be interviewed"
        wait(6)
    H.Text = "Welcome to your interview:D"
    wait(5)
    H.Text = "If BossScorp82103 is not in the game then there is not a interview session going on and there are just two players in the game"
    wait(5)
    H.Text = "To know if there is one going on check the Discord, under 'interview announcments' if there is one then BossScorp82103 is late... Which he/other admin should not be because..."
    wait(5)
    H.Text = "This should be a private server cause thats where real interviews happen from now on :D"
    wait (5)
    H.Text = "If BossScorp82103 is here and you are on the to be interviewed list"
    wait(5)
    H.Text = "GOOD LUCK:D"
    else
        H.Text = "If you cant get through the door its cause you are not the correct rank which is To be interviewed"
        wait(6)
        H.Text = "Hello, welcome to the interview place"
        wait(5)
        H.Text = "If you are seeing this it means there is no interview session going on right now"
        wait(5)
        H.Text = "To see when the next interview session is going to happen check our Discord and go to 'interview announcments' to see when one is going on"
        wait(5)
        H.Text = "How ever if there is a interview session today, BossScorp82103 or other host may be late, or your early:D"
        wait(5)
        H.Text = "Which is highly un likely because I changed the system :D meaning interviews happen on private server. :D"
        wait (5)
        H.Text = "since you're seeing this it is likely this is not real interview and you are just curious, well..."
        wait (5)
        H.Text = "Have a great day! And feel free to look around:D"
        wait(10)
    end
end

Hint()
wait (10)
H.Text = "The message will now repeat for the last time in 5 :D"
wait (1)
H.Text = "The message will now repeat for the last time in 4 :D"
wait (1)
H.Text = "The message will now repeat for the last time in 3 :D"
wait (1)
H.Text = "The message will now repeat for the last time in 2 :D"
wait(1)
H.Text = "The message will now repeat for the last time in 1 :D"
wait (1)
H.Text = "Message coming right now"
wait (1)
Hint()
wait (10)
0
Why is the code block not working??? BossScorp82103 22 — 6y
1
hint:Destroy() theCJarmy7 1293 — 6y
0
I can't upvote but it was answered by "theCJarmy7" thank you :D BossScorp82103 22 — 6y
0
i edited my answer so you can take a thing or two under consideration User#19524 175 — 6y
View all comments (2 more)
0
Please do not take anything incapaz says under consideration. FlynnXRider 4 — 6y
0
I recommend using tables {} for your messages and for i loops. This code can very well look much cleaner and easier to read. MessorAdmin 598 — 6y

1 answer

Log in to vote
-5
Answered by 6 years ago
Edited 6 years ago

You shouldn’t be using Hint’s since they are deprecated. Instead, use TextLabel’s and ScreenGui’s.

-- LocalScript

local plr = game:GetService('Players').LocalPlayer
local pgui = plr:WaitForChild'PlayerGui'

local screenGui = Instance.new'ScreenGui'
screenGui.Name = 'MessageGUI'
screenGui.Parent = pgui

local message = Instance.new'TextLabel'
message.Name = 'MessageLabel'
message.Parent = screenGui
-- You can edit more properties, such as position and color, etc.

message.Text = ""-- put your message here and just keep going

local countdownString = "The message will now repeat for the last time in "

------ Some later on code here ------

for i = 5, 0, -1 do --makes the countdown script
    message.Text = countdownString.. tostring(i) .. ":D"

    if i == 0 then
        message.Parent:Destroy()
        break
    end
    wait(1)
end
0
fixed it, thanks incapaz :D BossScorp82103 22 — 6y
Ad

Answer this question