‘’’
local part = script.Parent
local newZom1 = game.Workspace:WaitForChild(“newZom1”).Handle
local LocalPlayer = game:GetService(“Players”).LocalPlayer
debounce = false
part.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local char = plr.Character
if not debounce then
debounce = true
local canGet = true
if char and newZom1 and canGet then
print(“Our character touched the part!”)
print(plr.Name)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 21
newZ1 = newZom1:Clone()
newZ1.Name = “newZ1”
newZ1.Parent = game.Workspace
newZ1.BrickColor = BrickColor.Random()
newZ1.Anchored = true
newZom1:Destroy()
wait(1)
return
end
debounce = false
end
end
end)
‘’’