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

Why isn't hole a valid member of tool?

Asked by 6 years ago
Edited 6 years ago

Im trying to make a gun to my game, and i made this script:

01-- Algumas variaveis --
02local pistola = script.Parent
03local hole = pistola.Hole
04local mouse = game.Players.LocalPlayer:GetMouse()
05 
06-- Lista de Valores --
07local ammo = 12
08local maxAmmo = 64
09local damage = 20
10local headshotDamage = 50
11local range = 100
12local coolDown = 0.5
13 
14-- impedir spamming --
15local spam = false
View all 46 lines...

Ignore the parts were i speak portuguese :P But then i start recieving this error: 18:30:18.806 - Hole is not a valid member of Tool

idk what's happening, could you pls help me?

Also send a real answer, not a comment.

0
What is hole and is it a child of what ever script.Parent is? xPolarium 1388 — 6y
0
it's either the hole didn't load in or the hole isn't a child of Tool, if it is, try using pistola:WaitForChild("Hole") theking48989987 2147 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Hole probably dosen't exist inside the Tool

If it is try this:

pistola:WaitForChild("Hole")

0
ok mewant_taco 17 — 6y
0
Thank you :D mewant_taco 17 — 6y
Ad

Answer this question