Here's what I tried
wait(1)
local character = game.Workspace.Player1 -- I need 'Player1' to be the player that touched the block.
local player = game.Players:GetPlayerFromCharacter(character)
if player then
script.Parent.Touched:connect(function(touchedEffect)
wait(0.1)
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Script.Disabled = true
player.leaderstats.Pumpkins.Value = player.leaderstats.Pumpkins.Value +1
print'Pumpkin 1 has been collected. It will return in ten seconds!'
wait(10)
print'Pumpkin 1 has returned. It is now collectable!'
script.Parent.Transparency = 0
script.Parent.CanCollide = true
script.Parent.Script.Disabled = false
end)
end

1 comment
Thanks! You're awesome :)