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

Can someone tell me how to make the billboard gui disable itself after something ?

so i made a script right here

     function onTouched(hit)  --when the brick is touched activate--
          H = hit.Parent:FindFirstChild("Humanoid") --see if the thing that touched the brick is a humanoid--
               if H ~= nil then  --if it has a humanoid--
               script.Parent.BillboardGui.Enabled = true  --remove it--
          wait(.001)  --wait a few milliseconds(to prevent lag)--
     end  --end the process--
end  --end the process(if u know how to script you will know why i have 2 ends)--


script.Parent.touched:connect(onTouched)  --make sure it works--

but i cant figure out how to make the billboard gui to disable itself after the humanoid that was currently on it walks out of the brick, can someone help me

1 answer

Hello Cioss_Team! To do this we will use .Touched and .TouchEnded! Lets begin

part = --INSTANCE of part that will detect the touch
GUI = --INSTANCE of GUI that will be shown on touch

part.Touched:Connect(function(obj) --Detecting the touch
	if not obj.Parent:FindFirstChild("Humanoid") then return end --Making sure its a player
	GUI.Enabled = true  --Enabling the UI
end)

part.TouchEnded:Connect(function(obj)
	if not obj.Parent:FindFirstChild("Humanoid") then return end
	GUI.Enabled = false
end)

With any further questions/comments/concerns, feel free to reply to my answer. Happy scripting! ~mc3334

2 comments

0

it doesn't work, the Billboard GUI doesn't show.

0

I heard touch ended in not always relaible

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