I have a code that I'm trying to use where if a certain player joins, it will make a new sparkles instance inside the torso of that player. Here's what I have, but it's not working. I'm testing this in Roblox Studio, so the name is Player.
game.Players.PlayerAdded:connect(function(plr)
local name = plr.Name
if name == "Player" then
sparkles = Instance.new("Sparkles", game.Workspace.Player.Torso)
sparkles.Enabled = true
sparkles.SparkleColor = (255, 255, 0)
end
end)

2 comments
00:15:37.277 - Player is not a valid member of Workspace
I replied with an answer that should help.