我需要一个脚本,在Roblox中触摸一个Gui?

-3 roblox

当触摸砖块时,如何使脚本显示商店GUI?

我应该如何在商店GUI中制作"购买"的东西?

小智 6

你需要自己制作商店界面,但我会给你"GUI Giver"脚本.
注意:必须把脚本里面的砖/部分.

local Gui = game.Lighting.GUI --Replace this with the location of your GUI

function GiveGui(Player)
if Player.PlayerGui:FindFirstChild(Gui.Name)~=nil then return end
Gui:Clone().Parent=Player.PlayerGui
end

script.Parent.Touched:connect(function(hit)

local Player=game.Players:GetPlayerFromCharacter(hit.Parent)
if Player==nil then return end
GiveGui(Player)

end)
Run Code Online (Sandbox Code Playgroud)