- What do you want to achieve? Why, if i try change Value of Humanoid.Health at Client, its Changed Value on server too
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?
nope, i just changed Value of Humanoid.Health Use, Robloxstudio Stuff / Properties
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.
Use LocalScript instead of Script.
Let make this clear
- I test this thing on Dummy.
- When i change Health of dummy in client Early , its doesn’t effect to server.
- 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.
Try to put the testing script into a LocalScript. For setting the health, you can use a normal Script file for that.
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.
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.
- 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.
- but if, i try same thing to old dummy, its change health value on client side and server side
- 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.
- 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.
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.