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

why is the vehicle gui not comming up when touched?

I really wounder cus i am making a game where you can buy vehicles if you touch a brick but the gui dosent pop up when you touch it why?

function Shop()
	game.ReplicatedStorage.VehicleCatalog.Catalog.Visible = true
end
script.Parent.Touched:connect(Shop)

2 answers

It's because it's in ReplicatedStorage, a storage that no-one can see unless the item is taken out.

script.Parent.Touched:connect(function() 
	game.ReplicatedStorage.VehicleCatalog.Catalog.Visible = true --You'll have to take this out of replicated storage and throw it into PlayerGui
end

2 comments

0

Seriously? The same thing happens if you throw it in workspace! How about actually give an answer?

0

I didn't know if it was a value in a model or something. He didn't really give enough information. I assumed there was a changing value that whenever the value changed, a gui popped up. In order for a DECENT answer, he needs to give more information.

It's in ReplicatedStorage, you have to move it to the PlayerGui. Also, I recommend using debounces and FindFirstChild to make sure it's a player:

local debounce = false

function Shop(hit)
	if not debounce then
		if hit.Parent:FindFirstChild("Humanoid") then
			local clone = game.ReplicatedStorage.VehicleCatalog:Clone()
			clone.Parent = game.Players:FindFirstChild(hit.Parent.Name).PlayerGui
			deboune = true
			wait(5)
			debounce = false
		end
	end
end

script.Parent.Touched:connect(Shop)

Make sure the frame is already visible

5 comments

0

thanks

0

Can you press the accept button to make sure nobody else tries to answer this? Thanks!

0

Why would you downvote me? I literally said the samething as you.

0

Plus, you have an error in your script.

0

Okay, where's the error?

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