So I have a game called Blow Blocks Up! an I have decided to add points into the game. I'm trying to make it so that if someone shoots a rocket at a block they will earn 10 points. Here's my code:
local parent = script.Parent
local player
function onChildTouched(hit)
if hit.name == "Rocket" then
player = hit.creator.Value
game.Players:GetPlayerFromCharacter(workspace[player]).leaderstats.Points.Value = game.Players:GetPlayerFromCharacter(workspace[player]).leaderstats.Points.Value + 10
end
end
-- add a detection for when a child is touched
alright this is my game https://www.roblox.com/games/2850428770/Blow-Blocks-Up-Black-Hole OK i know this script might make it like Destruction Simulator but I still want it anyway.

5 comments
yeah should work
for line 29 you can also use "If v.ClassName == 'BasePart' then"
ok ill try this
BasePart is not a class name you would not be able to do it that way.
yes i had to change that