#how to open a shop with Interaction (proximity prompt)
1 messages · Page 1 of 1 (latest)
triggered doesnt work well for client
either use remote to let client know u are opening the shop or use prompt.inputholdbegan
also u got player paramter and another player inside the function
theres a lot to say here
a real lot
so first
you forgot to define the prompt argument. that means that the script will not find the prompt that you're trying to use
second, in the same line as the .PromptTriggered event, there is a player argument. Normally, that would be a player object. But then you define it as game.Players, the player service, and then you check if player is a humanoid, something which is clearly not.
also there actually no reason to use the ProximityPromptService, when you can just reference the actual prompt itself
the correct code would be
hold on lemme write it
ShopGUI is wrong
In a server script:
local Prompt = game.workspace.ShopModel.ProximityPrompt
Prompt.Triggered:Connect(function(plrWhoTriggered)
if plrWhoTriggered then
plrWhoTriggered.StarterGui:FindFirstChild("ShopGUI").Visible = true
end
end)```
It changes the gui on starter GUI not the player actual GUI
oh yeah also that
U dont need plrWhoTriggered
U dont need to check if it exists
Only players can fire triggered event of a proximity prompt
but you just said that his script would just get the starterguiservice gui instead
Yes but you dont need to check if it exists
so you would need to enable the actual gui by getting the player
oh
oh i see what u mean
still tho
this should somewhat work
Yes
alr, thanks for the help