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
You'd then use the CharacterAdded
event of the Player
to create a new smoke instance inside of the character's torso every time the player spawns.
local GamePassService = Game:GetService('GamePassService') local GamePassIdObject = WaitForChild(script, 'GamePassId') local function OnCharacterAdded(char) local smoke = Instance.new("Smoke", char:WaitForChild("Torso")) smoke.Color = Color3.new(1, 0, 0) -- red, remember to use 0-1 and not 0-255. If you want to use 0-255, just make sure to divide each number by 255. smoke.Size = 5 end local function OnPlayerAdded(player) if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then player.CharacterAdded:connect(OnCharacterAdded) end end Game:GetService("Players").PlayerAdded:connect(OnPlayerAdded)
id = 000000 -- Put the id of the GamePass Here game.Players.PlayerAdded:connect(function(plr) if game:GetService('GamePassService'):PlayerHasPass(plr, id) then plr.CharacterAdded:connect(function(char) c = plr.Character:GetChildren() for i = 1,#c do if c[i]:IsA("BasePart") then for i = 1,5 do s = Instance.new("Smoke", plr.Character.Torso) end end end end) end end)
You just need to put the smoke instance into the player. This will put 5 smoke instances into each Part of the Character.
Hope I Helped
+1