#how to open a shop with Interaction (proximity prompt)

1 messages · Page 1 of 1 (latest)

serene palm
#

I am a starter, so pls dont judge the code. This have been giving me headaches.

thorny narwhal
#

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

gaunt lagoon
#

"player:IsA("Humanoid")"?

#

you serious?

serene palm
#

I said Im a starter

gaunt lagoon
#

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

olive lodge
#

ShopGUI is wrong

gaunt lagoon
#

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)```
olive lodge
#

It changes the gui on starter GUI not the player actual GUI

gaunt lagoon
#

oh yeah also that

olive lodge
#

U dont need to check if it exists

#

Only players can fire triggered event of a proximity prompt

gaunt lagoon
#

but you just said that his script would just get the starterguiservice gui instead

olive lodge
#

Yes but you dont need to check if it exists

gaunt lagoon
#

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

olive lodge
#

Yes

gaunt lagoon
#

just paste it in a server script inside the shop model

#

(assuming you have one)

serene palm
#

alr, thanks for the help