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

Set new player with game pass on fire?

I've made the script but it doesn't seem to be working. No errors or output..

function onPlayerEntered(newPlayer)
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(newPlayer, 384198804) then
		newPlayer.CharacterAdded:connect(function(character)
		local char = character
		local kids = char:GetChildren()
		for _,k in pairs(kids) do
				if k.ClassName == "Part" then
				local fire = Instance.new("Fire")
				fire.Parent = k
				end		
			end
		end)
	end
end

1 answer

✓ Accepted answer

This should be able to fix all your current issues. It should also re-add fire upon re spawning

game.Players.PlayerAdded:connect(function(plr)
   plr.CharacterAdded:connect(function(char)
		local service = game:GetService("MarketplaceService")
        if service:PlayerOwnsAsset(plr, 331486478) then
            for _,k in pairs(char:GetChildren()) do
                     if k.ClassName == "Part" then
                       local fire = Instance.new("Fire",k)
                 end
              end
         end
      end)
end)



       

~~Approved by koolkid8099

31 comments

0

Thank you so much! A simple fix. You're very helpful. Others might have gotten angry at the fact that I messaged them, and disregarding my entire post upon doing so.

0

I was almost positive the script would work, but unfortunately it does the same thing in studio. No error to output and there are obviously no flames to be seen. I made sure to add the call.

0

add prints to your code to see where it errors

0

I've tried this and no prints show up, it's very unusual.

0

add a print to the first line.

0

add a print to every line to see if it prints

0

if not the script isn't enabled or somewhere it cant run.

0

Ahh wait it made it up until this line.

0

newPlayer.CharacterAdded:connect(function(character)

0

try replacing that with" repeat wait() until newPlayer.Character ". Dont forget to remove on of the ends.

0

attempt to index local 'char' (a nil value)

0

define char as newPlayer.Character

0

It works! The fire is super bright though. I'll need to adjust that.

0

If someone joins however, they will lose the fire when they die. How do I fix this?

0

I'm going to edit my code with the proper code you should have

0

Will you be posting it here?

0

Yes, i just updated my answer

0

It should work now.

0

Now it does not work at all. No output or anything.

0

what kind of script is this?

0

What do you mean?

0

I jsut tested my self, this is a roblox bug.

0

give me a second, im going to make you a work around

0

That would be amazing.

0

Ok, it was not a bug. It was an issue with the location of events, sorry for the delay

0

It works now

0

So it will stay with the player even after death?

0

It still will not work. D:

0

Nevermind it works.

0

Longest comment train I have ever seen. You're awesome Koolkid for helping until the answer gets solved.

0

LOL

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