You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear! (I want to make some dialogue GUI appear on the screen when stepping on a part, and want to keep it on screen for at least 15 seconds after stepping on the part)
What is the issue? Include screenshots / videos if possible! (I just don’t know how, I really am new to scripting, if this helps this is the GUI I want to enable/disable)
What solutions have you tried so far? Did you look for solutions on the Developer Hub? (As I said I don’t know many scripting so I couldnt even try to solve it as I would be a headless chicken looking for its nest.)
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
script.Parent.Touched:Connect(function(obj)
local h = obj.Parent:FindFirstChild("Humanoid")
if h then
game.Players[h.Parent.Name].PlayerGui.PonyDialog.Enabled = true -- So all of the frames in it appear at once
end
end)
This works as a debounce but the connection still gets fired every time you step on the part. For better performance, I would utilize an outer scope debounce with :Disconnect to disconnect the Touched connection.
true should have put a debounce in there but i didnt because if a player who hasnt touched it touches right after someone else the part wouldnt work for the second player
Yeah, while testing i realized that not only does it stay with you until you oof, but passing through the part again triggers it, however it would be pretty simple to fix the first problem, adding a part that just sets the GUI to be disabled whenever I would like the part to stop being visible
Anyways I believe the two issues the script presents has a way to fix it i can figure out by myself, so ill just mark the script as the solution, thanks for the help to all of you.