Hello, I would like to know how I can make a ‘Part’ be randomly cloned near the initial part and destroyed after being touched?
THIS
The part is cloned into 5 parts → the cloned part is randomly spawned near the part and then all the parts are destroyed.
Images:
Script:
local Player = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
local PlayerCharacter = Player:GetPlayerFromCharacter(hit.Parent)
if PlayerCharacter then
local Leaderstats = PlayerCharacter:WaitForChild("leaderstats")
Leaderstats.Cash.Value = Leaderstats.Cash.Value + 10
end
end)