Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Part wont change boolvalue on touch, still notices it touched a part?

So I'm trying to make an axe that will enable a value (to break said part) but when the tool touches a part with a child named "Broken" inside of it, it won't enable that value. The script knows it hit a part with the child "Broken" inside of it but it just won't enable the boolvalue. Please help!

script.Parent.Handle.axeblunt.Touched:Connect(function(hit)
	if hit:FindFirstChild('Broken') then -- checking if the hit part has the value
hit.Broken.Value = true
		print("Touched")
	end
end)

1 answer

✓ Accepted answer

I don't exactly know what you're trying to do but, this MIGHT help you! If it doesn't at least I tried and, you can always ask me in the comments for help.

I don't exactly know what you want from this or what you want to look so everything below is just my assumption.

Basically if you're looking for the value inside of a (handle? I think) this will get the job done. I tested it, you'll probably have to do some editing yourself to get exactly what you want accomplished but, I assure you that this DOES change the value to true on touch if the "hit" has a BoolValue instead of it called "Broken".

function whatever(hit)
	if hit.Broken.Value == false  then
		print("or whatever")
		hit.Broken.Value = true
	end
end
script.Parent.Touched:Connect(whatever)

1 comment

0

Thanks! It was really simple i just has to make it a script instead of a local script lol.

This discussion is preserved as it was. New answers, comments, and votes are closed.