|
| 16 Sep 2014 06:10 PM |
function GetGui() for i, v in pairs(script:GetChildren()) do if v:IsA("ScreenGui") then return v end end return nil end Gui = GetGui() Gui.Name = script.Parent.Parent.Name .. "ShopGui" script.Parent.Parent.Changed:connect(function() GetGui().Name = script.Parent.Parent.Name .. "ShopGui" end) while true do wait(.1) for i, v in pairs(game.Players:GetChildren()) do if v.Character ~= nil then if v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude <= 5 and v.PlayerGui:FindFirstChild(Gui.Name) == nil then Gui:Clone().Parent = v.PlayerGui elseif v.Character:FindFirstChild("Torso") ~= nil and (script.Parent.Position - v.Character.Torso.Position).magnitude > 5 then if v.PlayerGui:FindFirstChild(Gui.Name) then v.PlayerGui[Gui.Name]:Remove() end end end end end |
|
|
| Report Abuse |
|
|
| 16 Sep 2014 06:11 PM |
| Im trying to make it only open when I touch the brick and close when i leave it. |
|
|
| Report Abuse |
|