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

Why is "Touched" not a valid member of local script and can i change this or fix it?

Asked by 4 years ago
Edited 4 years ago

Im making a FireBall script for my game and i was just testing it and something is wrong with my fire damage script here:

script.Parent.Touched:connect(onDamage)

on this line on code it says touched is not a valid member of local script what can i use instead or at least fix it?? Here is the whole script:

function onDamage(Part)

if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~=

"script.Parent.Name" then

    script.Disabled = true

    for i = 1,25 do

        Part.Parent.Huamnoid.Health = Part.Parent.Humanoid.Health -1
        wait(0,05)
        end
    script.Parent:remove()

end
wait()

end script.Parent.Touched:connect(onDamage)

--

0
Have you tried in a server script? BashGuy10 384 — 4y
0
Also if you can provide your ENTIRE setup of the fireball, please do. BashGuy10 384 — 4y
0
No I haven’t tried server script and I will put my entire set up of it in the morning I just gtg get some rest scarymasterman123 4 — 4y
0
Btw the fireball is working it’s jut that 1. It doesn’t damage people/things because of the touches script thing - and 2. I don’t know why but I’m the only one able to see the fireball scarymasterman123 4 — 4y
View all comments (2 more)
0
The reason it wont appear on other people screens is becuase its a localscript BashGuy10 384 — 4y
0
Here is the entire script (sry i was ta school): scarymasterman123 4 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

On line 5: Part.Parent.Huamnoid.Health = Part.Parent.Humanoid.Health -1 - You spelled Humanoid wrong

Ad

Answer this question