Hello. I need a local proximity prompt script that can change properties of part and meshes only for the person who triggered the prompt.
Does anyone know how to do this?
Any help would be appreciated, thanks.
Hello. I need a local proximity prompt script that can change properties of part and meshes only for the person who triggered the prompt.
Does anyone know how to do this?
Any help would be appreciated, thanks.
Local Scripts and Remote Events.
If you want to modify properties on a part just for a certain client, fire a remote event to the player that triggered the proximity prompt and modify the properties of the part on client.
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local part = workspace:WaitForChild("Part")
local prompt = part:WaitForChild("ProximityPrompt")
prompt.Triggered:Connect(function(player)
if player == localPlayer then
part.BrickColor = BrickColor.Random()
end
end)
You can avoid remote events/remote functions for this by checking if the player that triggered the prompt is the same as the local player of which the local script is executing for.
Well yes, but that would mainly depend on the needs of the scripter, for example, he needs to give player damage when triggering also would require server-side.