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

How can I set the position of fire?

I'm trying to make some fire appear above a players head but it just goes inside their head and it looks really weird. I noticed that fire doesn't have a position attribute so I was wondering how I could set the fire to be above the players head, not in.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.Name == "zomspi" then
			local fire = game.ServerStorage.FireHeads.Blue:Clone()
			fire.Parent = char.Head
		end
	end)
end)

EDITED VERSION

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if plr.Name == "zomspi" then
            local part = game.ServerStorage.FireHeads.Blue
            part.Size = Vector3.new(.2,.2,.2)
            part.Parent = char
            local weld = Instance.new("Weld")
            weld.Part0 = char.Head
            weld.Part1 = part
            weld.Parent = part

            wait(0.1) -- this is only here because i couldn't get the position to move right but this makes it work. probably because the character wasn't loaded in
            part.Position = Vector3.new(char.Head.CFrame.X, (char.Head.CFrame.Y+5), char.Head.CFrame.Z) -- adjust the +1.5 however u want it
        end
    end)
end)

The fire is on the head but it doesn't go above it, just inside it, even if I increase the Y+5 Thanks!

5 comments

0

use a part. set the part above the players head (or on top of it really.) use CFrame to move it. make sure the part is not anchored and the transparency is 1 also make the part massless.

0

then put the fire inside of the part and modify it accordingly

0

That works but is there anyway I could do it without a while loop?

0

And my fire disappears after a short while

0

It just disappears instantly, I see a short burst of blue then it's gone

2 answers

✓ Accepted answer

this is what i mean. hope it helps. before you randomly script it, just clone your model and stick it in workspace without a server running. then find the exact settings for the part size and fire size set them in the script and you should be good

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if plr.Name == "yournamehere" then
            local fire = Instance.new("Fire")
            local part = Instance.new("Part")
			part.Size = Vector3.new(.2,.2,.2)
			part.Transparency = 1
			fire.Parent = part-- do ur fire settings before u set it to a parent so in other words above this
			part.Parent = char
			local weld = Instance.new("Weld")
			weld.Part0 = char.Head
			weld.Part1 = part
			weld.Parent = part
           	
			wait(0.1) -- this is only here because i couldn't get the position to move right but this makes it work. probably because the character wasn't loaded in
			part.Position = Vector3.new(char.Head.CFrame.X, (char.Head.CFrame.Y+1.5), char.Head.CFrame.Z) -- adjust the +1.5 however u want it
        end
    end)
end)

ok read my code. local fire = Instance.new("fire") I made a fire because I do not have the fire that you defined as being in ServerStorage.

The PART is required. when you used what I coded for your script, you set local part = game.ServerStorage.BlaBlaBla I don't care

basically you need to set local part = Instance.new("Part") and not what you had it equal to this will fix your problem

then set your local fire = game.ServerStorage.WhereverYourFireIsThatYouWant to clone.

try it

-- make it so your code has these variables

local fire = game.ServerStorage.FireHeads.Blue:Clone()
local part = Instance.new("Part")
-- be sure to set Fire.Parent = part

then it works

4 comments

0

I forgot that u want part.CanCollide = false

0

I made an edit to my original post with my new script, but it doesn't go above the head, just inside.

0

what exactly is blue? is it fire? or is it a model?

0

I edited my original post with an assumption.

@legoguy939 this is my script but the fire disappears after a bit?

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.Name == "zomspi" then
			local fire = game.ServerStorage.FireHeads.Blue:Clone()
			fire.Parent = char.Head
			while plr do 
				wait()

			fire.CFrame = char.Head.CFrame + Vector3.new(0,5,0)
			end
		end
	end)
end)

1 comment

0

i wasn't thinking to use a while loop. create a new weld and set the part0 and part1 to the fire brick and the head accordingly. this makes it so you don't have to constantly set the CFrame. Set the CFRame once and set the weld right after. Let me try to script this

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