so this is the code i use to make a humanoid take damage:
hit.Parent.Humanoid:TakeDamage(100)
but when it reaches 0 (i already conformed it did reach 0 with a print statement) it doeen't die why won't it die?
this is the script in the serverscriptservice:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("Damage")
remoteEvent.OnServerEvent:Connect(function(plr,dmg)
print(plr, "serverscriptservice")
print(dmg, "serverscriptservice")
end)
this is the code in the local script
game.ReplicatedStorage:WaitForChild("Damage"):FireServer(hit.Parent.Name,"50")
print(hit.Parent.Name)
print("50")
so for the serverscriptservice script the output is MY name then the thing i hit but it should be the thing i hit and the damage (which is a number) and for the local script the output is their name and the damage so how come it changes? and where does it get my name from? EDIT: i realized that before all of the variables it automatically makes it so the first var is the player that is running it so the new script is:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("Damage")
remoteEvent.OnServerEvent:Connect(function(me,plr,dmg)
game.Workspace:FindFirstChild()
end)

2 comments
Can you show us more of the script?
why? the hit.parent does run i conformed it with a print statement