I have been creating a simulator, and I was wondering how to open a shop screen gui that includes a scrolling frame by walking into a part that acts as a sensor. I have already created a sell part, so I duplicated it, and I'm trying to change the script to make it work as a shop.
Ok so, I'll get you here the script, but make sure to insert a Script
inside the part to where you want to be touched and get the gui.
local part = script.Parent game.Players.PlayerAdded:Connect(function(player) part.TouchEnded:Connect(function(hit) if hit.Parent:FindFirstChild("HumanoidRootPart") then -- If a player player.PlayerGui.GuiName:WaitForChild("ScrollingFrameName").Visible = false end end) end)
If you want that the ScrollingFrame must be closed when a person doesn't touch the part anymore, comment back. Ignore if you already have a close button.