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

Need help with fire scripted to the players torso?

hello i am making a game, but in the game i wanted my player to have fire in his torso so i kinda looked like a vortex, i have made it in studio and then put the model to code so when i spawn im the only one who has it, but its dont seem to work, it prints the text at the end but dont add fire to my torso. if anyone could help me and show where i went wrong that would be so helpful.

Thank you in advance

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		if plr.Name == "UpOntoNebula" then
			local fire = Instance.new("Fire", char.LowerTorso)
			fire.Color = Color3.new(44, 0, 67)
			fire.SecondaryColor = Color3.new(25, 109, 88)
			fire.Heat = 2
			fire.Size = 3
			fire.Enabled = true
			print("Fire Added")
		end
	end)
end)

4 comments

0

Have you set the fire to enabled?

0

it is enabled but when i go in test i cant find the fire within my player

0

does it print fire added, if not put it under plr.Name and tell me if it prints it then

0

yeah it prints fire added

1 answer

Hello, I will help you with this one:

  1. You should use :Connect instead of :connect because :connect is deprecated.
  2. You should set parent after you do all the changes to the instance (https://devforum.roblox.com/t/psa-dont-use-instance-new-with-parent-argument/30296)
  3. Other than that I didn't find anything wrong, make sure it is in ServerScriptService or Workspace and it is inside of Script

Fixed code:

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if plr.Name == "UpOntoNebula" then
            local fire = Instance.new("Fire")
            fire.Color = Color3.new(44, 0, 67)
            fire.SecondaryColor = Color3.new(25, 109, 88)
            fire.Heat = 2
            fire.Size = 3
            fire.Enabled = true
	    	fire.Parent = char.LowerTorso
        end
    end)
end)

Fixed code is tested and it's working.

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