Hello. This is the idea. When IsSick is 1 the player should take damage. But this does not happen for some reason. The IsSick value should be created in the PlayerStats folder in Players. And it finds him. But the player does not receive damage(
Some screenshots:
script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerStats = player:WaitForChild("PlayerStats")
local isSickValue = playerStats:WaitForChild("IsSick")
while true do
wait(5)
if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if isSickValue.Value == "1" then
humanoid.Health = humanoid.Health - 1
end
end
end