When I run the script, I get an error where it says that: humanoid is not a valid member of script
local Player = game.Players.LocalPlayer local char = Player.Character or Player.CharacterAdded:Wait() local Humanoid = char.Humanoid local fire = Instance.new("Fire") -- making fire fire.Parent = script.Parent -- putting it in the parent fire.Heat = 10 fire.Size = 4 for i = 1, 100 do script.Parent.Players.Humanoid:TakeDamage(0.1) -- making the player take damage wait(0.1) end fire:Destroy() -- removing the fire and the script script:Destroy()
Re-edited by JesseSong!
image https://www.linkpicture.com/q/Screenshot-2021-08-04-124957.png
You've already referenced the player, script.Parent You don't need to add script.Parent.Players because the game already knows what you're talking about.
To fix this just remove the .Players in the scripts and you're ready to go!
local Player = game.Players.LocalPlayer local char = Player.Character or Player.CharacterAdded:Wait() local Humanoid = char.Humanoid local fire = Instance.new("Fire") -- making fire fire.Parent = script.Parent -- putting it in the parent fire.Heat = 10 fire.Size = 4 for i = 1, 100 do script.Parent.Humanoid:TakeDamage(0.1) -- making the player take damage wait(0.1) end fire:Destroy() -- removing the fire and the script script:Destroy()
Remember that this has to go in StarterPlayer < StarterCharacterScripts