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

[ANSWERED] Im in a bit of a conundrum! Gamepass script help, where duth i go wrong?

game.Players.PlayerAdded:connect(function(Player)	
	local Head = Player.Character:WaitForChild("Head")	
	if Head then
		if game:GetService("GamePassService"):PlayerHasPass(Player, 351377310) then
			local FireEffect = Instance.new("Fire", Head)
			FireEffect.Heat = 9
			FireEffect.Size = 5
			FireEffect.Colour = Color3.new(236/255, 139/255, 70/255)
			FireEffect.Colour = Color3.new(139/255, 80/255, 55/255)
		end
	end
end)

Something to do with the character/player! Im not sure where though, please inform me.

2 comments

0

Output errors?

0

Also, on line two instead of using wait for child use find fist child. That way if there is no head it won't wait forever for the head to exist. Just a little thing.

1 answer

✓ Accepted answer

Try this,

game.Players.PlayerAdded:connect(function(Player)   
    local Head = Player.Character:WaitForChild("Head")  
    local id = --Place the gamepassID here!
    local hasPass = game:GetService("GamePassService"):PlayerHasPass(player, id)

    if Head then
        if hasPass then
            local FireEffect = Instance.new("Fire", Head)
            FireEffect.Heat = 9
            FireEffect.Size = 5
            FireEffect.Colour = Color3.new(236/255, 139/255, 70/255)
            FireEffect.Colour = Color3.new(139/255, 80/255, 55/255)
        end
    end
end)

What I have done is I defined hasPass, which I think should make this work.

If not, please blame my mentor and not me.


TheHospitalDev

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