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

How do I add to a NumberValue in a tool by using onTouch? (Ammo box)

I would like a couple bullets added to my weapon when I come into contact with a part using onTouch. I need a general idea of how to add to my NumberValue when I touch a certain brick so it's like an Ammo box.

2 comments

0

I belive your first attempt was good as it sounded like less of a request

0

As far as i could see it should be working. Did you try our recomendations to figure out the problem?

1 answer

local part = game.workspace.part
part.Touched:Connect(function(hit)
     local player = hit.parent 
     player.ammo.value = player.ammo.value + 100 
-- Change the path to the value
end)

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