while true do
wait(0.1)
local brick = script.Parent
local gui = brick.ShopGUI
local player = game.Players:GetChildren()
local distance = 15
for i=1,#player do
if ((brick.Position - player[i].Character.Torso.Position).magnitude>distance) then
local clone = gui:Clone()
clone.Parent = player.PlayerGui
brick.ShopGUI.Shop.Visible = false
elseif ((brick.Position - player[i].Character.Torso.Position).magnitude<distance) then
brick.ShopGUI.Shop.Visible = true
end
end
end
Hello, thank you for reading. I have a problem. When I come near the brick, it does not spawn the GUI and the GUI's Frame called "Shop". If there is something wrong, can anyone please explain it to me? I would be very grateful for your help!
