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
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)