As a Roblox developer, it is currently impossible to use Humanoid:GetPropertyChangedSignal(“Health”) with Humanoid:TakeDamage() as :TakeDamage doesn’t fire the Signal.
If Roblox is able to address your issue, how would it improve your game and/or your development experience? Please be as specific as possible.
By allowing TakeDamage() to fire GetPropertyChangedSignal() i think that it would work better as expected because TakeDamage indeed changes a property.
GIF
You can view a GIF by clicking here.
Place file & Code
You can see this place here
featurerequest.rbxl (19,5 KB)
Feel free to read the code below:
ChangedSignal:
b = script.Parent:WaitForChild("Humanoid")
b:GetPropertyChangedSignal("Health"):Connect(function()
print"Health changed"
end)
Server side:
ReplicatedStorage = game:GetService("ReplicatedStorage")
Event = ReplicatedStorage:WaitForChild("RemoteEvent")
Character = game.Workspace:WaitForChild("Character")
Event.OnServerEvent:Connect(function(Player,...)
local Args = {...}
if Args[1] == "TakeDamage" then
Character.Humanoid:TakeDamage(50)
elseif Args[1] == "SetHealth" then
Character.Humanoid.Health = 50
end
end)
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("RemoteEvent")
local GUI = script.Parent
local Damage1 = GUI:WaitForChild("Damage1")
local Damage2 = GUI:WaitForChild("Damage2")
Damage1.MouseButton1Click:Connect(function()
Event:FireServer("TakeDamage")
end)
Damage2.MouseButton1Click:Connect(function()
Event:FireServer("SetHealth")
end)
It can be observed that TakeDamage does not fire the changed signal, which is unexpected behavior to me.