I'm sorry that this doesn't follow guidelines, but I have no idea where to start on this script and there is literally no resource on the entire web that I could find that would help me figure this out. The title is pretty self explanatory. Although, I want to make it so that the gui doesn't appear on the block its self, but the specific player that steps on it. I just want a general idea of what might be able to do this, not the full script its self.
EDIT:
Okay, I understand what I need to do for this to happen. Although, I'm not exactly sure how to code it. How do I use TouchEnded with a function? Heres what I got so far:
local function onTouch(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil) then print("Gui cloning goes here") end end script.Parent.Touched:connect(onTouch) Signal TouchEnded ( BasePart otherPart )
EDIT: According to one of the comments below, you do it the exact same way that you do with OnTouch. The thing is, when I tried this, the output literally got spammed with the TouchEnded message.
local function onTouch(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil) then print("Gui cloning goes here") end end local function TouchEnded(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil) then print("Touch Has Ended") end end script.Parent.Touched:connect(onTouch) script.Parent.Touched:connect(TouchEnded)
Simple! Connect a function to the 'Touched' event of a part. Check if the part has a humanoid in it, and if it does, check if the part's parent's name is also a player. If so, then clone a GUI to their PlayerGui. Then, another function to handle the 'TouchEnded' event of a part, and do the same checks. If they are a player, then check if they have the GUI in their PlayerGui. If so, destroy it!
TL;DR Touched and TouchEnded on a part to clone / destroy GUI to/from players who step on it.