Water damage and water immortality not working

i want to make it so that when a player touches the water the player gets damage but thats working. the thing thats not working is that i want it to not take damage if a value says so. but the value isint changing. here is the script:

local button = script.Parent
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local race = workspace.PlayerStats.Race.Value

button.Activated:Connect(function(player)
	script.Parent.Visible = false
	script.Parent.Parent.GloomWeavers.Visible = false
	script.Parent.Parent.Emberkin.Visible = false
	script.Parent.Parent.Luminities.Visible = false
	workspace.Damage.Value += 2
	hum.WalkSpeed += 5
	race = "tidewalker"
end)

please respond. :slight_smile:

thats the script i used to change the value but the value wont change and i know the damage script will work.

What script gives the damage? And what is the value to prevent from taking damage?

the value is tide walker. i don`t need help with the script giving damage the thing is that the value itself isint changing

i think i found the solution but im not too sure

didnt work. please help;;;;;;;

You can’t really do that, if you want to change the value then you have to do

local race = workspace.PlayerStats.Race
-- later in the code
race.Value = "tidewalker"

Hope this helps! :smile: