What im trying to achieve here is when you press a key bind, a fire trail will clone into workspace wherever your mouse goes. But it stays in one place and does not move with the mouse. Can anyone help?
local ReplicatedS = game:GetService("ReplicatedStorage")
local PainEvent = ReplicatedS:WaitForChild("firetrail")
local ts = game:GetService("TweenService")
PainEvent.OnServerEvent:Connect(function(player, mouse)
local players = game.Players
local player = players.LocalPlayer
local victim = mouse.Parent:FindFirstChild("Humanoid")
local victimCharacter = mouse.Parent
local pained = victimCharacter:FindFirstChild("Pained")
local h = victimCharacter:findFirstChild("Humanoid")
local Player = victimCharacter
local Char = victimCharacter
local victimplayer = game.Players:GetPlayerFromCharacter(victimCharacter)
local timeRemaining = 10
local bonniefire = game.ServerScriptService.GameFolder.Spells.CharacterSpells.Bonnie.firetrail.firetrailpart
while timeRemaining > 0 do
print("Seconds remaining: " .. timeRemaining)
wait(0.1)
timeRemaining = timeRemaining - 1
local firetrail = bonniefire:Clone()
firetrail.Parent = game.Workspace
firetrail.Position = mouse.Hit.Position
--firetrail:Destroy()
end
wait(11)
local fires = game.Workspace:FindFirstChild("FireTrail")
fires:Destroy()
end)
