Hi, i'm trying to add smoke to player's torso when players who have bought my vip gamepass have joined the game. i am currently using this script but i am not done with it.
local GamePassService = Game:GetService('GamePassService')
local GamePassIdObject = WaitForChild(script, 'GamePassId')
local function OnPlayerAdded(player)
if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
--script that adds smoke to the body here
end

6 comments
The smoke didn't appear when i started the game, the output was this --- 17:14:54.957 - Workspace.vip smoke:2: attempt to call global 'WaitForChild' (a nil value) 17:14:54.957 - Stack Begin 17:14:54.958 - Script 'Workspace.vip smoke', Line 2 17:14:54.958 - Stack End --- @ Ekkoh
That is from your code -- it should be your problem to solve. . . Use
script:WaitForChild("GamePassId")instead.I suggest studying anonymous function. It could shorten code considerably and make it easier for the community to read, getting you more answers faster.
thank you it worked but just one more question if its not to much, how do i configure the smoke if i want it to be red, or bigger. @BlueTaslem @GoldenPhysics
Made an edit :)
Thank you Ekkoh