Fuzakeru
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 27 |
|
|
| 16 Mar 2015 01:18 PM |
**I'm making a horror game and this part requires a gui to appear on touch of a brick, I got it working BUT I CAN'T GET IT TO LEAVE! PEASE HELP! ANYONE WHO HELPS GETS 35 ROBUX**
wait(1) local near = false
local debounce = true if near == true then while wait(0.1) do for i,v in pairs(game.Players:GetChildren()) do if v.Character.Torso ~= nil then if(v.Character.Torso.Position - script.Parent.Position).magnitude < (script.Parent.Size.X /1) + 10 then if v.PlayerGui:findFirstChild("ExampleGui") ~= nil then return end script.ExampleGui:clone().Parent = v.PlayerGui end end end end elseif near == false then if debounce == true then debounce = false script.Parent.Touched:connect(function(hit) local human = hit.Parent:findFirstChild("Humanoid") if (human == nil) then return end local player = game.Players:findFirstChild(hit.Parent.Name) if (player == nil) then return end if player.PlayerGui:findFirstChild("ExampleGui") ~= nil then return end script.ExampleGui:clone().Parent = player.PlayerGui end) debounce = true end end |
|
|
| Report Abuse |
|