Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Game pass custom particle doesn't work, what is wrong with the script?

So I'm trying to make a game pass for a custom particle on your torso, but for some reason, it doesn't work.

local passId = 837872254 -- change this to your game pass ID.
 
function isAuthenticated(player) -- checks to see if the player owns your pass
	
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end

game.Players.PlayerAdded:connect(function(plr)

    if isAuthenticated(plr) then

        plr.CharacterAdded:connect(function(char) --We don't need two PlayerAdded events because the first one already got the player.

        local Particle  = Instance.new("ParticleEmitter",game.Workspace.Torso)
        Particle.VelocitySpread = 360
        Particle.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 0.2)})
        Particle.Rate = 50
        Particle.Texture = "http://www.roblox.com/asset/?id=258128463"
        Particle.Name = "Sparks"
        Particle.Parent = char:WaitForChild("Torso")

        end)

    end

end)

Once I delete this line:

        Particle.VelocitySpread = 360
        Particle.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 0.2)})
        Particle.Rate = 50
        Particle.Texture = "http://www.roblox.com/asset/?id=258128463

It works, but it's a regular particle which I don't really want. NOTE: I want this particle: http://www.roblox.com/asset/?id=258128463

1 comment

1 answer

Agh simple answer!

local passId = 12345678 -- change this to your game pass ID.
 
function isAuthenticated(player) 
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end -- 
 
game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then 
        local name = plr.name  -- we are making the players name a variable
     
end
end)

So now we can access the player in the workspace with the variable we just created!
Say your particle is just called particle1, okay?

local passId = 12345678 -- change this to your game pass ID.
 
function isAuthenticated(player) 
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end
 
game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
        local name = plr.name  -- we are making the players name a variable
     	game.Workspace.Particle1:Clone().parent = game.Workspace:WaitForChild(plr) 
end
end)

Now we just made that script do stuff! Hope that helps This code should be in a regular script in workspace

This discussion is preserved as it was. New answers, comments, and votes are closed.