Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I code player specific scripts?

For E.G

If i want bloom to be active for only a player when he walks over a specific area. What terms do I use that only THAT SPECIFIC player that has WALKED at that area will see the bloom effect and the script shouldn't make the bloom active for everyone.

1 comment

0

use a local script and part touched?

1 answer

The best and quickest solution for this is to use FilteringEnabled and part hitboxes.

When a hitbox is touched, the server sends an event to the client that it then receives and creates a local bloom effect that will only be visible on the client.

Here's an example of a Server Script in a hitbox part that'll send the event to the client:

local Hitbox = script.Parent

Hitbox.Touched:connect(function(Object))
if Object.ClassName == "Part" then
if Object.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:GetPlayerFromCharacter(Object.Parent)
Player.SomeEventsFolder.ActivateBloom:FireClient(Player)
end
end
end)

(Haven't tested)

Then you'll just set everything up, make a folder in StarterPlayerScripts with the event and a local script that will listen to the event and make a bloom effect when needed, also don't forget to edit the script above if you're using it, the remote firing line includes randomly picked directories.

1 comment

0

Can you please guide me through

This discussion is preserved as it was. New answers, comments, and votes are closed.