Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. db = false
  2.  
  3. script.Parent.Touched:connect(function(hit)
  4. if db == false then
  5. db = true
  6. local isHuman = hit.Parent:FindFirstChild("Humanoid")
  7. if isHuman ~= nil then
  8. local guiEvent = Instance.new("RemoteEvent", script.Parent)
  9. guiEvent.Name = "guibuttonevent"
  10. local playerfound = game.Players:GetPlayerFromCharacter(hit.Parent)
  11. local guiclone = game.ReplicatedStorage.gui1:clone()
  12. guiclone.Parent = playerfound.PlayerGui
  13. print("Cloned element named: "..guiclone.Name) --debug line
  14. guiclone.Frame.Position = UDim2.new(-1,0,0.5,0)
  15. guiEvent:FireClient(playerfound)
  16. print("Event triggered for: "..playerfound.Name) --debug line
  17. end
  18. wait(0.5)
  19. db = false
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement