I have a ServerScript in a tool that is meant to give the player character insane hp for a short period of time. The script is fired via a remote event in the tools local script, and the script fires correctly, but the health does not change.
Script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Plyr)
if Plyr.Bool.Value == true then
local SavedHealth = Plyr.Character.Humanoid.Health
print(SavedHealth)
Plyr.Character.Humanoid.Health = math.huge
print(Plyr.Character.Humanoid.Health)
local Field = Instance.new("ForceField")
Field.Parent = Plyr.Character
wait(8)
Field:Destroy()
Plyr.Character.Humanoid.Health = SavedHealth
end
end)
It is worth mentioning that the forcefield is applied and destroyed, but not the hp.
There is also nothing in the output.
How do I fix this?