Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = false
- script.Parent.Touched:connect(function(hit)
- if db == false then
- db = true
- local isHuman = hit.Parent:FindFirstChild("Humanoid")
- if isHuman ~= nil then
- local guiEvent = Instance.new("RemoteEvent", script.Parent)
- guiEvent.Name = "guibuttonevent"
- local playerfound = game.Players:GetPlayerFromCharacter(hit.Parent)
- local guiclone = game.ReplicatedStorage.gui1:clone()
- guiclone.Parent = playerfound.PlayerGui
- print("Cloned element named: "..guiclone.Name) --debug line
- guiclone.Frame.Position = UDim2.new(-1,0,0.5,0)
- guiEvent:FireClient(playerfound)
- print("Event triggered for: "..playerfound.Name) --debug line
- end
- wait(0.5)
- db = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement