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

When The Code Gets To the Elseif part it wont change, any help?

So i was making a script from some anime cause i was bored and stuff, here is the code:

Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
Hot = false
Cold = false
--Hotz To the touch
local FireParticle = game.Lighting.FireParticle:Clone()
local FireParticle2 = game.Lighting.FireParticle:Clone()

--Oh no too Cold
local ColdParticle = game.Lighting.ColdParticle:Clone()
local ColdParticle2 = game.Lighting.ColdParticle:Clone()

game:GetService("UserInputService").InputBegan:connect(function(input)
	if input.KeyCode ~= Enum.KeyCode.Z then return end;
	if Hot == false and Cold == false then
		print("To Hot To Touch")
		Hot = true
		for i = 1,25 do
			local Effect = game.Lighting.Effect_Shockwave:Clone()
			Effect.BrickColor = BrickColor.new("Bright orange")
			Effect.Size = Vector3.new(10, 10, 10)
			Effect.Parent = game.Workspace
			Effect.CFrame = Player.Character.Torso.CFrame * CFrame.Angles(0, math.random(-90, 90), 0)
			wait(0.01)	
		end
		wait(0.3)
		FireParticle.Parent = Player.Character["Left Arm"]
		FireParticle.Enabled = true
		FireParticle2.Parent = Player.Character["Left Leg"]
		FireParticle2.Enabled = true
	else
		if Hot == true then
			Hot = false
			FireParticle.Enabled = false
			FireParticle2.Enabled = true
			wait(0.3)
			FireParticle:Remove()
			FireParticle2:Remove()
			
			if Cold == false then
				Cold = true
				
				for i = 1,25 do
					local Effect = game.Lighting.Effect_Shockwave:Clone()
					Effect.BrickColor = BrickColor.new("Baby blue")
					Effect.Size = Vector3.new(10, 10, 10)
					Effect.Parent = game.Workspace
					Effect.CFrame = Player.Character.Torso.CFrame * CFrame.Angles(0, math.random(-90, 90), 0)
					wait(0.01)
				end
				wait(0.3)
				ColdParticle.Parent = Player.Character["Right Arm"]
				ColdParticle.Enabled = true
				ColdParticle2.Parent = Player.Character["Right Leg"]
				ColdParticle2.Enabled = true
			elseif Cold == true then  --Problem!
				ColdParticle.Enabled = false
				ColdParticle2.Enabled = false
				wait(0.3)
				ColdParticle:Remove()
				ColdParticle2:Remove()
			end
		end
		end
end)

but when it gets to the elseif part it does not work, what it suppose to do is get rid of the cold particle and reset. Any way i can get help on this, and any way i can improve?

1 comment

0

why are you using lighting to store objects?

1 answer

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