This script is suppose to give players with a certain gamepass sparkles when they join the game. when i play the game it doesn't work, also there are no errors in the output.
local GamePassService = Game:GetService('GamePassService') local GamePassIdObject = script:WaitForChild('GamePassId') local function OnCharacterAdded(char) local smoke = Instance.new("Sparkles", char:WaitForChild("Torso")) end local function OnPlayerAdded(player) if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then player.CharacterAdded:connect(OnCharacterAdded) end end Game:GetService("Players").PlayerAdded:connect(OnPlayerAdded)
Thanks.