and also, if applicable, how could multiple guis pop up when a brick is touched?
script.Parent.Touched:connect(function (hit) if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then Play = game.Players[hit.Parent.Name] if Play:FindFirstChild("PlayerGui") and not Play.PlayerGui:FindFirstChild(GUI.Name) then GUI:Clone().Parent = Play.PlayerGui end end end)
it is going to be for a shop gui, so once you touch the shop, a menu would pop up where you can buy items, i just want the gui popping up done also, the screenguis name is ShopGui1
You could do this.
local Part = script.Parent Part.Touched:connect(function(HIT) local H = HIT.Parent:FindFirstChild("Humanoid") if H then local Player = game.Players:GetPlayerFromCharacter(HIT.Parent) Player.PlayerGui.GUINAME.Frame.Visible = true end end)
Place it inside a brick. And change "GUINAME.Frame" to Where the gui you want to show is located, I'm sure you can figure out how to modify this.
does this work?
script.Parent.Touched:connect(function(hit) if(hit ~= nil)then if(hit.Parent:FindFirstChild("Humanoid") ~= nil)then local player = game.Players:GetPlayerFromCharacter(hit.Parent) workspace.Shop.ScreenGui:Clone().Parent = player:FindFirstChild("PlayerGui") end end end)