#Calling proximity prompts from a table of objects

1 messages · Page 1 of 1 (latest)

eternal robin
#

Trying to make multiple "Journals" that the player can find and read during his playthrough.
Every Journal(Phone) has a proximity prompt and a Billboard Gui.

I'm willing to make a script, that somehow gets a proximity prompt of the phone, that the player uses - and connecting Triggered event of that particular Phone to a function.

But I'm struggling to figure out a way to find that proximity prompt for this script.

I'm currently thinking about making a spherical zone, that is attached to the player - so when the closest phone enters that zone - the script can find the Proximity prompt of that phone.

Do you have any ideas on how to do what I'm willing to do, but a different way maybe?

midnight stag
#

could you explain this a bit more? I assume you're saying that you're able to connect the proximity prompt fired event to a function but you are unable to get the proximity prompt object to another script?

eternal robin
midnight stag
#

you can fire a custom event which then allows you to send info to another script through it

#

e.g. when a player would perform a proximity prompt action, fire a bindable event and pass through the proximity prompt triggered. create another script and have a listener for when that event fires with the parameter for the proximity prompt

eternal robin
midnight stag
#

it’s as simple as creating a bindable event in server storage, referencing it in the two scripts you want, and have one script fire the event and the other have a .event listener

#

give me a moment

#

this would be within the first script

#

and this within the second

#

all you'd need to do is just reference the event, fire to send the instance of the proximity prompt, and perform whatever operation you'd like with that prompt

midnight stag
eternal robin
midnight stag
#

yes, for your case all you'd need to do is pass in the proxPrompt variable

#

you could use a module script, though i'm not sure what your plans are- so proceed however you'd like

eternal robin
#

Okay, I guess I kind of see how a Bindable even could help me resolve my problem.
Thank you for your help <:)

sweet spearBOT
#

studio** You are now Level 1! **studio

midnight stag
#

you're welcome- you'll learn better practices eventually, getting your scripts to work is the hardest part of your journey

eternal robin
midnight stag
#

hmm, could you give me an example to better understand what you're trying to do? I understand that you're trying to get the return value when the event is fired, though I don't understand why you need to do so and what you're trying to acheive after

eternal robin
#

I want to pass that object "prompt" that the Event found - to the other function that I made, so that function can understand which object to work with.

Did this, and it supposedly will do what I want it to do dogepopcorn