Hey developers, I was wondering if there was a way to achieve something where you spawn in with a particle, For example, I am making a Flash Game and I want any player who spawns in to have a “zap” particle effect around them or a lightning particle effect. Is this possible?
It is possible, but I am not very experienced in VFX.
Just do Workspace:ChildAdded() or Player.PlayerAdded() for seeing if the player hsa joined.
Then just load the particle effect you want into workspace
1 Like
It is possible, put a script inside of server script service with this code and put the particle under the script.
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
repeat wait() until plr.Character ~= nil
wait(0.05)
local clone = script.["NAME OF THE PARTICLE HERE"]:Clone()
clone.Parent = plr.Character.HumanoidRootPart
end)
1 Like
Is this supposed to be local
or just loca
?
Yes it is supposed to be local, I just typed it in the dev forum that’s why I had a typo
Oh okay Sorry about that, i didnt notice you had a typo
1 Like
local Game = game
local Players = Game:GetService("Players")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
task.wait()
local Head = Character:FindFirstChild("Head") or Character:WaitForChild("Head")
local Sparkles = Instance.new("Sparkles")
Sparkles.Parent = Head
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
https://developer.roblox.com/en-us/api-reference/class/Sparkles