On my magic spell i have a sound effect, LocalScript which should send out a Mesh

bin = script.Parent
player = script.Parent.Parent.Parent
me = script.Parent.Parent.Parent

enabled = true

function onButton1Down(mouse)
	
if not enabled then
		return
	end

	local player = game.Players.LocalPlayer
	if player == nil then return end
     enabled = false
		local animTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Handsigns)
		animTrack:Play()
		wait(0.7)
		Fireball = Instance.new("Part")
		Fireball.BrickColor = BrickColor.new("Bright red")
		Fireball.Size = Vector3.new(9, 9, 9)
		Fireball.TopSurface = "Smooth"
		Fireball.BottomSurface = "Smooth"
		Fireball.Shape = "Ball"
		Fireball.Name = ("Fireball")
		Fireball.CanCollide = false
		Fireball.Transparency = 0.35
		Fireball.Parent = game.Workspace
		Fireball.CFrame = me.Character.Torso.CFrame*CFrame.new(0, 0, -12) -- orig -12
		FireballMesh = script.Mesh:Clone()
		FireballMesh.Parent = Fireball
		Aura = Instance.new("Part")
		Aura.BrickColor = BrickColor.new("Neon orange")
		Aura.Size = Vector3.new(9.5,9.5,9.5)
		Aura.TopSurface = "Smooth"
		Aura.BottomSurface = "Smooth"
		Aura.Shape = "Ball"
		Aura.Name = "FireballAura"
		Aura.CanCollide = false
		Aura.Transparency = 0.6
		Aura.Parent = Fireball
		Aura.CFrame = Fireball.CFrame
		AuraMesh = script.Mesh:Clone()
		AuraMesh.Parent = Aura
		Weld2 = Instance.new("Weld")
		Weld2.Parent = Fireball
		Weld2.Part0 = Fireball
		Weld2.Part1 = Aura
		Weld2.C0 = CFrame.new(0,0,0)
		Flames = Instance.new("ParticleEmitter")
		Flames.Parent = Fireball
		--Flames.Color = ColorSequence.new(Color3.new(255/255,0,0), Color3.new(198/255, 111/255, 40/255))
		Flames.Speed = NumberRange.new(10)
		Flames.Transparency = NumberSequence.new(0.25,0.25)
		Flames.Size = NumberSequence.new(2.5,2.5)
		Flames.Rate = 750
		Flames.Lifetime = NumberRange.new(0.8)
		Flames.Texture = "rbxassetid://249250640"
		fd = script.Firedamage:clone()
		fd.Disabled = false
		fd.Parent = Fireball
		y = Instance.new("BodyVelocity")
		y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
		y.velocity = me.Character.Torso.CFrame.lookVector*180 --Change the number here for the speed of the jutsu.
		y.Parent = Fireball
		
		game.Debris:AddItem(Fireball, 6)
		RandomNumber = math.random(game.Workspace.EXPRate.MinEXP.Value,game.Workspace.EXPRate.MaxEXP.Value)
		game.Players.LocalPlayer.leaderstat.EXP.Value = game.Players.LocalPlayer.leaderstat.EXP.Value - RandomNumber
		game.Players.LocalPlayer.PlayerGui.Chakra.ChakraStored.Value = game.Players.LocalPlayer.PlayerGui.Chakra.ChakraStored.Value - 40
		game:GetService("Chat"):Chat(game.Players.LocalPlayer.Character.Head, "Fire Release: Fireball Jutsu!")
		script.Parent.Jutsu:Play()
wait(6)
enabled = true
end

enabled = true
function onS(mouse) 
mouse.Button1Down:connect(function() onButton1Down(mouse) end) 
end 
bin.Selected:connect(onS)

I am unsure why this is not working for a short time it was working but now it isn't, is there fault with my script?

1 comment

0

Anyone?