#particle emitter not showing

1 messages · Page 1 of 1 (latest)

winged gale
#

why cant this code clone a particle emitter to my character when i tuch the part local finish = script.Parent

local cd = false

local function onTuched(object)
local player = game.Players:GetPlayerFromCharacter(object.Parent)
cd = true
player.leaderstats.Wins.Value = player.leaderstats.Wins.Value + 1
player.Character.HumanoidRootPart.CFrame = game.Workspace.SpawnLocation.CFrame
local sparkle = game.ReplicatedStorage.ParticleEmitter:Clone()
sparkle.Parent = player
task.wait(3)
sparkle:Destroy()
task.wait(2)
cd = false
end

local function run(hit)
if cd == false and hit.Parent:FindFirstChild("Humanoid") then
onTuched(hit)
end
end

finish.Touched:Connect(run)

willow escarp
#

Youd have to parent the particle emitter to an actual part on the player so that it can emit

#

e.g for torso

local function onTuched(object)
    local player = game.Players:GetPlayerFromCharacter(object.Parent)
    cd = true
--    player.leaderstats.Wins.Value = player.leaderstats.Wins.Value + 1
    player.Character.HumanoidRootPart.CFrame = game.Workspace.SpawnLocation.CFrame
    local sparkle = game.ReplicatedStorage.ParticleEmitter:Clone()
    local hmn:Humanoid = player.Character:FindFirstChild("Humanoid")
    sparkle.Parent = hmn.Torso
    task.wait(3)
    sparkle:Destroy()
    task.wait(2)
    cd = false
end