local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Cash")
cash.Value = cash.Value +10
wait(1)
script.Parent:clone().Parent = game.ReplicatedStorage
script.Parent:remove()
wait(5)
game.ReplicatedStorage.Iron1:clone().Parent = game.Workspace
game.ReplicatedStorage.Iron1:remove()
end
end
end
ting = 0
end
script.Parent.Touched:connect(onTouched)
How can i make this smaller but still give the money to the player who touched the brick (hit.Parent.Parent) i want to add in
if hit.Name == "Pick" then
--(Give the player the money or the script above executes)
Anything useful is... useful
