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

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

Asked by
rdkv 12
4 years ago

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.

0
I belive your first attempt was good as it sounded like less of a request OBenjOne 190 — 4y
0
As far as i could see it should be working. Did you try our recomendations to figure out the problem? OBenjOne 190 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
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)
Ad

Answer this question