Dummy Humanoid.Health Problem

  1. What do you want to achieve? Why, if i try change Value of Humanoid.Health at Client, its Changed Value on server too
2 Likes

What are you trying to do specifically? Is it when a player touches a part, then it kills the player by changing the health value to 0?

1 Like

nope, i just changed Value of Humanoid.Health Use, Robloxstudio Stuff / Properties

1 Like

Did you just change your character Humanoid.Health?
not on other players or other stuffs just yourself

It will update on the server too if you do it on yourself.

2 Likes

Use LocalScript instead of Script.

1 Like

Let make this clear

  1. I test this thing on Dummy.
  2. When i change Health of dummy in client Early , its doesn’t effect to server.
  3. and i change Health value on Dummy use this Script.
local a = script.Parent:WaitForChild("Humanoid")
a.MaxHealth = 30000
a.Health = a.MaxHealth

local b = Instance.new("IntValue")
b.Parent = script.Parent
b.Name = "maxhp"
b.Value = a.MaxHealth


local c = Instance.new("IntValue")
c.Parent = script.Parent
c.Name = "Hp"
c.Value = b.Value

and then when i Change Health value of dummy, use Properties on cllient its, changed health of Dummy in server too.

1 Like

Try to put the testing script into a LocalScript. For setting the health, you can use a normal Script file for that.

2 Likes

Health must be changed by the server in order to replicate.
You shouldn’t modify the humanoid’s health at all on the client-side.

2 Likes

btw im not modifed Humanoid.Health, on the client side. i just put normal script inside the dummy

Why, if i try change Value of Humanoid.Health at Client, its Changed Value on server too

That is incorrect.
Anyways, since you’re using a script and not a localscript, I don’t see your issue.

2 Likes
  1. when i change new dummy all things is work perfcely, when i change Health value of dummy, use Properties on client its, changed only health on client side only.
  2. but if, i try same thing to old dummy, its change health value on client side and server side
  1. when i change new dummy all things is work perfcely, when i change Health value of dummy, use Properties on client its, changed only health on client side only.

Then use a server-script instead.

  1. but if, i try same thing to old dummy, its change health value on client side and server side

If it’s a server-script, yes.

No it won’t update your health, however you can forcefully set your own state to dead.

Then use a server-script instead.

Im use server script to both of dummy

If it’s a server-script, yes.

i just changed Humanoid.Health on client side only, but why its effect to server side ?

i just changed Humanoid.Health on client side only, but why its effect to server side ?

If it’s affecting the server, you did not change it via a localscript because it does not replicate.

bro, just try this dummy bro, and then try changed health of dummy in client side
https://www.roblox.com/library/7084621433/Testdummy

You will be able to see the change but not the server.

bro,i swear its change the server too. How i know ? cause i trying use this script too.

> script.Parent.Humanoid.HealthChanged:Connect(function(health)
> 	if health == 0 then
> 	print("Die")
> 	end
> end)

and its printed in server side bro.

HealthChanged is a client-sided-only event.

1 Like

bro, i fix my problem I don’t know if this is related, but its work, when i change my dummy
HumanoidRootPart.Anchored = false, and then i change my dummy health in client side, its change server side too. but when i change HumanoidRootPart.Anchored = True, and then i change my dummy health, its only effect on client side, not server side.