Hi, I'm trying to make it that if a player reaches a certain amount of rebirths and levels, they gain this particle emitter(Like an aura) cloned into their torso.
Here is my script:
game.Players.PlayerAdded:Connect(function(player) if player.leaderstats.Levels.Value >= 50 and player.leaderstats.Rebirths.Value >= 5 then game.ServerStorage.Auras.Lightning:Clone().Parent = player.Torso print("Torso Given") end end)
The script is a ServerScript inside of StarterCharacterScripts. The ParticleEmitter is in ServerStorage.
Is something wrong in the method I'm using to clone it? Or am I incorrectly accessing the torso? Also, the print doesn't show up.
You seem to have mixed up the player and his character. The player object does not have a torso, however his character does; but in order to access the character you'll have to wait for the .CharacterAdded
event to fire.
Like below:
players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) particleEmitter:Clone().Parent = character:FindFirstChild("Torso") end) end)
Ok, here is my script now
game.Players.PlayerAdded:Connect(function(player) local Aura = game.ServerStorage.Auras.Lightning player.CharacterAdded:Connect(function(Char) if player.leaderstats.Levels.Value >= 50 and player.leaderstats.Rebirths.Value >= 5 then Aura:Clone().Parent = Char:FindFistChild("Torso") end end) end)
I still don't see anything print or any errors occur.
: