Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Humanoid is not a valid member of Script? [closed]

Asked by 2 years ago
Edited by JesseSong 2 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

when i run the script i get a error where it says that humanoid is not a vaild member of script

heres the code

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()

1
Can you post your script? JustinWe12 723 — 2y

Closed as Non-Descriptive by JesseSong

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 2 years ago

Well did you try getting the humanoid value like this?

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local Humanoid = char.Humanoid

if so then I don't know because I am a beginner scripter.

0
now i have a error saying attempt to index nil with 'Character' Guest_player1689 2 — 2y
0
yea, that'll only run in a localscript JesseSong 3916 — 2y
Ad