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

How can I open a Gui with a ProximityPrompt? - Help!

Hi Developers and Programmers, today I need your help. I have a problem, I want to change the function of opening the GUI with a ClickDetector. and put it to open with a ProximityPrompt, the script:

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
		local newUI = script.CarSpawnUI:Clone()
		newUI.Parent = plr.PlayerGui
		newUI.MainFrame:FindFirstChild("LocalScript").Disabled = false
end)

If someone can give me the solution it would help me a lot. Thanks.

- ManuelCortesYT, SCS-Studios CEO

1 answer

✓ Accepted answer

For a ProximityPrompt you have to put "CarSpawnUI" disabled insert "StarterGui." With that you can do the following code.

local plr = nil
script.Parent.ProximityPrompt.Triggered:Connect(function(plrthattriggered)
plr = plrthattriggered
for i,player in pairs(game.Players:GetPlayers()) do
if player.Name == plr.Name thebn
player.PlayerGui.CarSpawnUI.Disabled = false
end
end)

1 comment

0

Thank you so much!

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