Hi! I got a Touched event which I want a part called "DirtyRock" to be hit/h (the parameter of touched event) and when that happens, I want the DirtyRock to be destroyed and add a more value to the leaderstats.Money.Value. Here is my script: (it doesn't work)
local RemovePortal = script.Parent
local player = game.Players.LocalPlayer
RemovePortal.Touched:Connect(function(hit)
local DirtyRock = game.Workspace.Tycoon.DropPortal.Rocks.Part
if hit == DirtyRock then
DirtyRock:Destroy()
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 5
end
end)
RemovePortal is the script that will have the event in it meaning its RemovePortal.Touched (keep in mind the script is in RemovePortal)

1 comment
But that would increase the amount for every player, not just the player which touched the part.