✓ Accepted answer
No, you don't need to use remote events or any sort of that complicated stuff,
follow this:
GuiGiver = script.Parent
gui = script.Parent.ScreenGui
function GiveGui(part)
local Playername = part.Parent.name
local cloned = gui:Clone()
if game:GetService("Players")[Playername].PlayerGui:FindFirstChild(gui.Name) then
else
cloned.Parent = game:GetService("Players")[Playername].PlayerGui
end
end
GuiGiver.Touched:connect(GiveGui)
Make sure that the part is anchored, and does not touch any other part, you can make it also not colliding.
Here is my setup in workspace, and it works perfectly:
Image
if you have any question about this script, let me know :D!
note: use view source and paste that script into your Roblox editor, this answer box messes up the script a little bit, I guarantee that it will be easier to comprehend.
2 comments
put ScreenGui in StarterGui and put the script in ScreenGui , script.Parent.Enabled = true
Doesnt Seem To Work I put this in a local script function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = true end script.Parent.Touched:connect(onTouched)