Hello there I have a doubt scripting this, how do I make this? when you touch a brick you recieve a player point, now I have this script, but I am not sure if its correct
local egg = script.Parent
egg.Touched:connect(function(part)
local g = game.Players:GetPlayerFromCharacter(part.Parent)
if part:IsA("Part") and (g) then
local f = g:findFirstChild("leaderstats")
local n = f:FindFirstChild("Points")
n.Value = n.Value + 1
egg:remove()
end
end)

1 comment
I got it from another post