What do you want to achieve? Keep it simple and clear!
Well i would like to make a Proximity prompt that only activates on the client for a specific user.
What is the issue? Include screenshots / videos if possible!ù
I don’t really know how to achieve this. Do i need to use a Client Side Local Script that gets informations from a RemoteEvent from the Server? Or do i need to do anything else?
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I did look at the Creator Hub for solutions. But i didn’t found any topics that talk about my exact issue.
ServerSide Example: (Module Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClientSideRemote = ReplicatedSotrage.ClientSideRemote
local ProximityPrompt = workspace.ProximityPrompt
ClientSideRemote:FireClient(ProximityPrompt, "ProximityPrompt", true)
ClientSide Example: (Local Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClientSideRemote = ReplicatedSotrage.ClientSideRemote
ClientSideRemote.OnClientEvent(parameter1 ,Type, parameter2)
if Type == "ProximityPrompt" then
parameter1.Enabled = parameter1
end
end
Seems like there are a few mistakes in your script: ReplicatedStorage is mispelled in both scripts, you are also not passing in the player to fire the event for in your ModuleScript, and it seems that you meant to put parameter1.Enabled = parameter2 instead of parameter1.Enabled = parameter1. Other than that, these scripts seem like they should work fine.
Oh wait I think I understand what you want, you want a single client to have a Prox Prompt chosen from the server side. In that case you just choose them from the server, fire a RemoteEvent:FireClient(), handle that on the client side and make the prox prompt on the client side.
What are you taking about? Of course you can fire remote events from module scripts… you just have to make sure you’re using the correct fire event based on the run context.
If you just want client side effects when activating prompt you can do this:
local script under PlayerScripts
-- [[ VARIABLES ]]
local ProximityService = game:GetService("ProximityPromptService")
-- [[ FUNCTIONS ]]
ProximityService.PromptTriggered:Connect(function(prompt)
if prompt.Name == "Blind" then
-- let's say we have blind effect applying here
end
end)
I also had another question: Can you change the prompt text for 1 client while the other clients see something else? For example: Player A sees “Pickup” but Player B and other Players see “Steal”.
As long as you change the value on the client (using either a LocalScript or a script with the RunContext set to Client) you can show different prompt text for different users
Here’s an example of using a Script w/ the RunContext set to Client
local owner = --[[ Get the owner's player, maybe ObjectValue? ]]
local prompt = script.Parent
prompt.ActionText = if game.Players.LocalPlayer == owner then "Pickup" else "Steal"
You’d just place this script under the prompt, and find some way of getting the owner’s Player, storing it as ‘owner’ in the script