I wanted a magic that it shoots smoke and when you press again it lits on fire, making a huge explosion that deals damage to near people.
There are no errors that appear on the output however it doesnt work
https://gyazo.com/0135c7debb3311d0c8bc9b6f9b7083e1
As you can see, the smoke appear’s normally but doesnt go straight and when I press X again it doesnt explode like I wanted.
Server script service
local FlameFolder = game:GetService("ReplicatedStorage").Flame
local Remote = FlameFolder.Remote.FlamePillar
local TweenService = game:GetService("TweenService")
local Touched = false
local Informatic = TweenInfo.new(
0.5,
Enum.EasingStyle.Cubic,
Enum.EasingDirection.Out,
0,
false,
0
)
local Propreties = {Size = Vector3.new(22, 22, 22)}
local Debris = game:GetService("Debris")
local NewMesh = FlameFolder.Meshes.Smoke:clone()
Remote.OnServerEvent:Connect(function(plr,IsRunning)
if IsRunning == true then
local Character = plr.Character or plr.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Table = {
A = FlameFolder.Meshes.FlameExplosion.A0:Clone(),
A1 = FlameFolder.Meshes.FlameExplosion.A1:clone(),
}
Table.A.Parent = workspace
Table.A1.Parent = workspace
Debris:AddItem(Table.A,5)
Debris:AddItem(Table.A1,5)
local NewTween = TweenService:Create(Table.A,Informatic,Propreties)
local NewTween1 = TweenService:Create(Table.A1,Informatic,Propreties)
NewTween:Play()
NewTween1:Play()
Table.A.CFrame = NewMesh.CFrame
Table.A1.CFrame = NewMesh.CFrame
Table.A.Touched:Connect(function(hit)
if hit.Parent == plr.Character then return end
if hit.Parent:FindFirstChild("Humanoid") and not Touched then
Touched = true
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
wait(5)
Touched = false
end
end)
Table.A1.Touched:Connect(function(hit)
if hit.Parent == plr.Character then return end
if hit.Parent:FindFirstChild("Humanoid") and not Touched then
Touched = true
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
wait(5)
Touched = false
end
end)
NewMesh:Destroy()
else
local Character = plr.Character or plr.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
NewMesh.CanCollide = false
NewMesh.Parent = workspace
NewMesh.CFrame = Character:WaitForChild("RightHand").CFrame
IsRunning = true
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://10269614145"
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
local Debris = game:GetService("Debris")
local NewBodyV = Instance.new("BodyVelocity",NewMesh)
NewBodyV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
NewBodyV.Velocity = HumanoidRootPart.CFrame.LookVector * 75
end
end)
Local script in backpack
local FlameFolder = game:GetService("ReplicatedStorage"):WaitForChild("Flame")
local Remote = FlameFolder.Remote.FireBall
local debounce = false
local UIS = game:GetService("UserInputService")
local Remote2 = FlameFolder.Remote.FlamePillar
local IsRunning = false
local plr = game.Players.LocalPlayer
local GUI = plr.PlayerGui
local Z = GUI:WaitForChild("ScreenGui").Z.ZB
local X = GUI:WaitForChild("ScreenGui").X.XB
local C = GUI:WaitForChild("ScreenGui").C.CB
--Z--
UIS.InputBegan:Connect(function(input, istyping)
if istyping then return end
if input.KeyCode == Enum.KeyCode.Z and not debounce then
debounce = true
Remote:FireServer()
script.Fireball:Play()
wait(9)
debounce = false
end
end)
Z.TouchTap:Connect(function()
if debounce == false then
debounce = true
Remote:FireServer()
script.Fireball:Play()
wait(9)
debounce = false
end
end)
--Z END--
--X--
UIS.InputBegan:Connect(function(input, istyping)
if istyping then return end
if input.KeyCode == Enum.KeyCode.X and not debounce then
debounce = true
Remote2:FireServer(IsRunning)
script.Fireball:Play()
wait(6)
debounce = false
end
end)
X.TouchTap:Connect(function()
if debounce == false then
debounce = true
Remote2:FireServer(IsRunning)
script.Fireball:Play()
wait(6)
debounce = false
end
end)
--X END--
Thank you!