Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My shop frame doesn't open when I walk on the pad?

game.Workspace.Shopg.Touched:Connect(function(hit) if hit then script.Parent.Shop.Frame.Visible = true end end)

4 comments

0

Is this inside starterGui

0

you are missing an end)

0

He isnt...

0

oh i didn't saw that sorry

2 answers

game.Workspace.Shopg.Touched:Connect(function(hit)
	if game.Players:GetPlayerFromCharacter(hit.Parent) then
		script.Parent.Shop.Frame.Visible = true 
	end
end)

Also, models don't have the touched property.

I've made a very simple script for you to follow To learn more about events then visit: https://developer.roblox.com/en-us/recipes/Check-When-Something-Touches-a-Part


script.Parent.Shopg.Touched:Connect(function(hit) -- Checks whatever hits has a humanoid
	if hit.Parent:FindFirstChild("Humanoid")then -- Finds the First child which was humanoid
		script.Parent.Shop.Frame.Visible = not script.Parent.Shop.Frame.Visible  -- Does the opposite of the frame so if its true it will be false after 3 seconds
		wait(3) -- Time it takes for the GUI to fire

	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.