Hi, I am trying to make a tool in roblox that makes people blind. How do I make the tool affect only one player at a time.
I am aware of lighting but that affects the whole server.
Thanks for help
Hi, I am trying to make a tool in roblox that makes people blind. How do I make the tool affect only one player at a time.
I am aware of lighting but that affects the whole server.
Thanks for help
If your game has FilteringEnabled, then anything done in a LocalScript will only be visible to the player.
If you wanted to create a PointLight object when the player clicks with the tool, then you would do this in a LocalScript:
-- localscript
local tool = script.Parent
tool.Activated:Connect(function()
local pointLight = Instance.new("PointLight")
pointLight.Parent = workspace
end)
The above script will create a new PointLight object that can only be seen by the player who clicked.
I hope this helps :)
thx a lot, this really helped!
Mess around with local. If you use "local" before a line of code, it will only affect the player who is having the script run on them, or just use a local script, but I advise the first one.
I don't think you understand the usage of 'local'. That's used to define the scope of a variable to be within it's local environment, not to be applied only to the local player.
It honestly depends.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Handle the code on the client.