So basically I made a part that on touched gives you a gui, but if you keep touching it you keep getting the gui. Is it possible to make it so it detects if you already have the gui. As from what I have seen the server even with knowing who the player is cannot see what gui they have
You can add some lines of code that verifies so that if the player already has the GUI the function won't fire
local players = game:GetService("Players") local part = script.Parent local GUI = part:WaitForChild("YourGUI") --//Pretend the GUI is located there local function onTouched(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then --//Checks if it has a humanoid local playerName = hit.Parent.Name local sPlayer = players:WaitForChild(playerName) local playerGui = sPlayer:WaitForChild("PlayerGui") if playerGui:FindFirstChild("YourGUI") then return end --//Checks if the GUI is already at the player's screen, if true then return end local newGUI = GUI:Clone() newGUI.Parent = playerGui --//Clones the GUI to the player's screen end end part.Touched:Connect(onTouched)
This is the first solution that came into my head, warn me if any error pops up