Bubble script for a tool No Output
local bubble = script.Parent
bubble.Touched:connect(function(hit)
if hit:FindFirstChild("Value") and hit.Value == 30 then
hit:Destroy()
print(hit.Name)
end
bubble:remove()
end)
Bubble script for a tool No Output
local bubble = script.Parent
bubble.Touched:connect(function(hit)
if hit:FindFirstChild("Value") and hit.Value == 30 then
hit:Destroy()
print(hit.Name)
end
bubble:remove()
end)
It's probably because you are searching the part that the bubble hit for a value, rather than a character or something like that.
bubble.Touched:connect(function(hit)
if hit:FindFirstChild("Value") and hit.Value == 30 then
hit:Destroy()
print(hit.Name)
end
bubble:remove()
end)
if hit:FindFirstChild("Value") and hit.Value == 30 then
This line checks the part that touched the bubble for an object named "Value", if "Value" is parented to a character and you are waiting for a player to hit the bubble, then you need to change that line to this:
if hit.Parent:FindFirstChild("Value") and hit.Parent:FindFirstChild("Value").Value == 30 then
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I tried that
In that case I have no idea.