You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
A win effect that works
2. What is the issue?
The issue is that if the player wins the particle effect like goes onto every player but what I want is particles to go on the player that won and everyone can see!
What solutions have you tried so far?
Finding a solution
local db = false
local player = game.Players.LocalPlayer
local particle = game.ReplicatedStorage.ParticleEmitter:Clone()
game.Workspace.MapForGlassPlatforms.Respawn.Door.Part.Touched:Connect(function()
game.Workspace.WinScript.GiveWin:FireServer()
if not db then
db = true
particle.Parent = player.Character.HumanoidRootPart
script["Win Sound"]:Play()
task.wait(5)
particle.Parent = game.ReplicatedStorage
db = false
end
end)
local db = false
local players = game:GetService("Players")
local particle = game.ReplicatedStorage.ParticleEmitter:Clone()
game.Workspace.MapForGlassPlatforms.Respawn.Door.Part.Touched:Connect(function(h)
local player = players:GetPlayerFromCharacter(h.Parent)
if h.Parent:FindFirstChild("HumanoidRootPart") then
if player then
if not db then
db = true
particle.Parent = player.Character.HumanoidRootPart
script.WinSound:Play()
task.wait(5)
particle.Parent = game.ReplicatedStorage
db = false
end
end
end
end)