How To Check if a proximity prompt have been triggered in a local script?

Can you at least maybe show the heirarchy of parts where the proximity prompt is located?

sorry for the long wait , the video took a long time uploading lol

heres the link proximity prompt issue - YouTube

1 Like

what is the interaction time on the proximity prompt

The duration of the proximity prompt is zero seconds

Fill in the player parameter and then trying printig the player that triggered the proximity prompt

it works in the server but nothing prints in the client

Yeah because you have it on a server script not in a local script

its feels exactly like the local script have been disabled or something, nothing prints

Where exactly do you have the local script if you dont mind me asking

i mean it works and prints in the server but when i copy the exact script in a local script it wont work and nohting prints

it is currently in the proximity prompt

1 Like

And where exactly is the proximity prompt

1 Like

it is inside the part

(ignore this)

Local scripts can’t run in workspace they have to be in either StarterCharacterScripts, StarterPlayerScripts, ReplicatedFirst

4 Likes

Don’t use a localscript, they don’t work for 99% of cases in the workspace. Use a script with the run context set to local.

oh my god i just got a scripting blindness, this is the most logical answer that i have missed lmao thank you for the help ,

wont that make it a local script?

No, they’re different. Ones a localscript, with the classname “localscript”, ones a script that runs locally.

2 Likes

Or use a remoteevent, and fire it with the serverscript.
EXAMPLE:
this is serverscript

script.Parent.ProximityPrompt.Trigged:Connect(function())
	game.ReplicatedStorage.RemoteEvent:FireClient()
end

and this is localscript (shove it anywhere besides workspace)

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function)
	-- action here
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.