I want to numerate each ball that are cloned and spawned, So when like 5 secs goes out, it despawn.. Here is my script:
local UserInputService = game:GetService("UserInputService")
local throwing = false
local Player = game.Players.LocalPlayer
local Character = game.Workspace:WaitForChild(Player.Name)
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Fire = game.Workspace.Effect.Fire:Clone()
local Sound = game.Workspace.Effect.Sound:Clone()
--//Animations
Throw = Instance.new("Animation")
Throw.AnimationId = "rbxassetid://3307466402"
ThrowTrack = Humanoid:LoadAnimation(Throw)
--//Coding
UserInputService.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E and not throwing then
throwing = true
Humanoid.WalkSpeed = 0
ThrowTrack:Play()
Fire.Parent = Character.LeftHand
local radius = Instance.new("Part")
radius.Shape = "Ball"
radius.Anchored = true
radius.CanCollide = false
radius.Color = Color3.fromRGB(249, 169, 70)
radius.Material = Enum.Material.Neon
radius.Parent = Character.LeftHand
radius.Size = Vector3.new(2,2,2)
radius.Position = Character.LeftHand.Position
Fire.Parent = radius
Sound.Parent = radius
Sound:Play()
wait(1)
throwing = false
Humanoid.WalkSpeed = 18
end
end)

2 comments
Oh god you actually make me learn something so useful! thanks you! By the ways, quick things apart, how could i make that my "Fire" get into each radius instead of just the current one?
@Shematics We make a clone of the fire when the event is fired and use that, it will be destroyed along with the radius when it disappears, I edited the answer to include that.