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.........................................................................................

01H = Instance.new("Hint",workspace)
02function Hint()
03    if
04        game.Players.NumPlayers >1
05        then
06        H.Text = "If you cant get through the door its cause you are not the correct rank which is To be interviewed"
07        wait(6)
08    H.Text = "Welcome to your interview:D"
09    wait(5)
10    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"
11    wait(5)
12    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..."
13    wait(5)
14    H.Text = "This should be a private server cause thats where real interviews happen from now on :D"
15    wait (5)
View all 54 lines...
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.

01-- LocalScript
02 
03local plr = game:GetService('Players').LocalPlayer
04local pgui = plr:WaitForChild'PlayerGui'
05 
06local screenGui = Instance.new'ScreenGui'
07screenGui.Name = 'MessageGUI'
08screenGui.Parent = pgui
09 
10local message = Instance.new'TextLabel'
11message.Name = 'MessageLabel'
12message.Parent = screenGui
13-- You can edit more properties, such as position and color, etc.
14 
15message.Text = ""-- put your message here and just keep going
View all 29 lines...
0
fixed it, thanks incapaz :D BossScorp82103 22 — 6y
Ad

Answer this question