I am trying to make a proximity prompt that opens a shop ui, but it won’t work
this is a local script
local ui = game.StarterGui.Shop
script.Parent.Triggered:Connect(function()
ui.Enabled = true
end)
I am trying to make a proximity prompt that opens a shop ui, but it won’t work
this is a local script
local ui = game.StarterGui.Shop
script.Parent.Triggered:Connect(function()
ui.Enabled = true
end)
donot reference ui in startergui instead reference them in PlayerGui
local player = game.Players.LocalPlayer
local ui = game.Players.LocalPlayer.PlayerGui
final script
local player = game.Players.LocalPlayer
local ui = player.PlayerGui.Shop
script.Parent.Triggered:Connect(function()
ui.Enabled = true
end)
and if its a server script then do this
script.Parent:Connect(function(player)
local ui = player.PlayerGui.Shop
ui.Enabled = true
end)
Still doesnt work
This is what the updated script looks like
local player = game.Players.LocalPlayer
local ui = player.PlayerGui:WaitForChild("Shop")
script.Parent.Triggered:Connect(function()
ui.Enabled = true
end)
is it a server or client script? also did you get any errors?
It is a localscript
No errors
ignore this i have to put this here for some reason
is the local script in workspace?
if tho local scripts doesn’t run in workspace by default you will have to add a normal script and set RunContext to client
It is in the proximity prompt
I once again have to put this here for some reason
is the proximity prompt on workspace? local scripts donot run in workspace
if u want it to work in workpace add normal script
and set this to client
A proximity prompt does not even appear at all in the workspace, and no it is in a part
and the part is in workspace right? just tell me where you added it in workspace/replicatedstorage/etc…
i tested the script with screenGui named “Shop” and it worked fine
The proximity prompt is in a part, that is in a rig, that is in the workspace
YEAH so its in the workspace normal scripts in workspace are server scripts by default you will have to set the runcontext to “Client” so it will work
i dont see anything in the script called runcontext
because you added a local script remove it and add a “Script” but not “LocalScript”
BUT donot add this one
i gtg