#proximity prompts

1 messages · Page 1 of 1 (latest)

pseudo marlin
#

can someone just teach me how they work

crystal viper
pseudo marlin
#

nope thanks

pseudo marlin
#

i didnt know abt it

#

is this set up right?

#

because it isnt working

#

this is the localscript i made just to test it

cold pawn
#

cant use a local script if its not in the player's character or in the player

pseudo marlin
#

alright

#

its just destroying it straight away

#

how can i make it only happen when the prompt is triggered

cold pawn
#

theres an example on how to code proximity prompts at the bottom of the documentation page that was sent here

pseudo marlin
#

it only gives an example of how to do it through the global proximitypromptservice

cold pawn
#

just replace proximitypromptservice with your proximity prompt and it works pretty sure

pseudo marlin
#

what do u mean?

#

theres no PromptTriggered event

crystal viper
sour light
#

But if you want everyone to see the changes. Hook up that event to a remote

#

And have a server script listen and then delete the bush

cold pawn
#

it works server sided

crystal viper
#

Did you mean deleting the bush only works client sided? not the prompt itself?

sour light
cold pawn
#

yeah

crystal viper
#

The prompt absolutely works across the boundary

cold pawn
#

95% of my proximity prompts in my game are server sided

pseudo marlin
#

so what do i do

#

should i just use the proximitypromptservice

crystal viper
pseudo marlin
#

yeah that works thanks

#

however the bush is still just deleting itself straight away

crystal viper
#

Oh! Sorry. That event is from ProximityPromptService which is a more global way of handling prompts.

sour light
#

Yeah that’s server sided my fault

pseudo marlin
crystal viper
sour light
crystal viper
# pseudo marlin i assume this code is wrong somehow

Yes it's wrong

You have to pass a function into Connect. You're instead passing what Destroy() returns (which is nothing I think)

You can do something like

proximityprompt.Triggered:Connect(function()
  bush:Destroy()
end)

instead, where we give it the function we want to run, and you destroy the bush inside that function

pseudo marlin
#

alright i had a feeling it would be something like that

crystal viper
pseudo marlin
#

(the spider is the player model) it still dont work

crystal viper
pseudo marlin
#

yep

hollow hornetBOT
#

studio** You are now Level 8! **studio

crystal viper
pseudo marlin
#

alright

#

it didnt fix it

crystal viper
pseudo marlin
#

its 10

#

ill make it 100

#

still doesnt work

crystal viper
pseudo marlin
#

alright

#

yep that worked

#

thanks

#

this is a script which sets a score, and i wanna make it so the food variable increases when i eat the bush, im guessing im gonna have to rewrite this script somehow but how can i do this?

crystal viper
pseudo marlin
#

so how do i get the playerWhoTriggered

crystal viper
pseudo marlin
#

ohh alright thats useful

#

thats so much easier than i thought itd be

#

thanks a lot

crystal viper
pseudo marlin
#

is there any way to customise the actual interact button?

#

like not which button u press and what text it displays

#

like could i draw it myself and use it

crystal viper
pseudo marlin
#

yeah i assumed it would be

#

thanks for the help

pseudo marlin