humanoid.HealthChanged:connect(function()
local players = game:GetService("Players")
end)
I want to assign a variable to the player who makes it lose health.
humanoid.HealthChanged:connect(function()
local players = game:GetService("Players")
end)
I want to assign a variable to the player who makes it lose health.
Step 1: is your code in a localscript? if not, you cannot. Step 2: fixing,
if you are using a normal script, dont use local player:
game.Players[humanoid.Parent.Name]
if you are using a localscript:
game.Players.LocalPlayer
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
LocalPlayer is client only, change your question, also it's way harder than were you're thinking of, I normally use 'tags' wich I give to the player when a player damages him with the damager his name on it (stringvalue)
Can u give an example?
katt, is this a localscript or a script
Elixcore -- > probably a script because you cannot change health with a local one (you can but it won't replicate)