No damage from value(

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:
image
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

Is isSickValue a number or a string value? As you are comparing it to a string "1" instead of 1

1 Like

Lol,I just did IntValue which was not correct. Im created new stringValue and it works. Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.