So today I wanted to make a flamethrower for my fps game and the stuff worked very well until the damage was multiplied for how long you have been holding it the script is a bit long since it uses other tools too
wait()
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Char = player.Character
local Arms = game.Workspace.Camera:WaitForChild("Arms")
local Server = game.ReplicatedStorage.Guns.FPS
local BatIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Bat.Hold)
local BatMove = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Bat.Walk)
local BatHold = Char.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Bat.HoldServer)
local BatHit = Arms.Humanoid:LoadAnimation(Server.Bat.Hit)
local dbBat = false
local ClayIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.ClaymoreExplosive.Hold)
local MKIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Medkit.Hold)
local MK1 = false
local MK2 = false
local MK3 = false
local Bandage = Arms.Humanoid:LoadAnimation(script.Medkit.Bandage)
local Spray = Arms.Humanoid:LoadAnimation(script.Medkit.Spray)
local ShieldHold = Char.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Shield.HoldServer)
local FBIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.FlashBang.Hold)
local FLIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Flashlight.Hold)
local FL = false
local G3DIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS["3DGlasses"].Hold)
local FIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.Frag.Hold)
local PKIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.KrazesPlushie.Hold)
local Flame = false
local FTIdle = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.FlameThrower.Hold)
local FTMove = Arms.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.FlameThrower.Walk)
local FTHold = Char.Humanoid:LoadAnimation(game.ReplicatedStorage.Guns.FPS.FlameThrower.HoldServer)
mouse.Button1Down:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
if script.Parent.Value then
if script.Parent.Value.Name == "FlameThrower" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
Flame = true
script.FlameThrower.Activated:Play()
if Arms.Items:FindFirstChild("FlameThrower") then
Arms.Items:FindFirstChild("FlameThrower").Thrower.Pos.Flame.Enabled = true
Arms.Items:FindFirstChild("FlameThrower").Thrower.Pos.Smoke.Enabled = true
end
end
end
end
end
end
end
end)
mouse.Button1Up:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
if script.Parent.Value then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
if script.Parent.Value.Name == "FlameThrower" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
Flame = false
script.FlameThrower.Activated:Stop()
if Arms.Items:FindFirstChild("FlameThrower") then
Arms.Items:FindFirstChild("FlameThrower").Thrower.Pos.Flame.Enabled = false
Arms.Items:FindFirstChild("FlameThrower").Thrower.Pos.Smoke.Enabled = false
end
end
end
end
end
end
end
end)
function G3D()
for _,v in pairs(script.Glasses3D.Players:GetChildren()) do
v:Destroy()
end
for _,v in pairs(game.Workspace.Placed:GetChildren()) do
for _,item in pairs(v:GetChildren()) do
if item.Name == "Hitbox" or item.Name == "Trigger" then
else
if item:IsA("BasePart") or item:IsA("MeshPart") or item:IsA("Part") or item:IsA("UnionOperation") then
local Box = Instance.new("BoxHandleAdornment",script.Glasses3D.Players)
Box.Adornee = item
Box.Color3 = Color3.fromRGB(174, 74, 118)
Box.AlwaysOnTop = true
Box.ZIndex = 1
Box.Size = item.Size
Box.Transparency = 0.65
end
end
end
end
for _,v in pairs(game.Players:GetChildren()) do
if v.Name == game.Players.LocalPlayer.Name then
else
Instance.new("Folder",script.Glasses3D.Players).Name = v.Name
for _,name in pairs(v.Character:GetChildren()) do
if name.Name == "Left Leg" or name.Name == "Right Leg" or name.Name == "Right Arm" or name.Name == "Left Arm" or name.Name == "Torso" then
local C2 = v.Character:WaitForChild("Changed2")
if C2.Value == "" then
local Box = Instance.new("BoxHandleAdornment",script.Glasses3D.Players[v.Name])
Box.Adornee = name
Box.Color3 = Color3.fromRGB(0, 153, 255)
Box.AlwaysOnTop = true
Box.ZIndex = 1
Box.Size = name.Size
Box.Transparency = 0.65
else
local Box = Instance.new("BoxHandleAdornment",script.Glasses3D.Players[v.Name])
Box.Adornee = name
Box.Color3 = Color3.fromRGB(255, 46, 46)
Box.AlwaysOnTop = true
Box.ZIndex = 1
Box.Size = name.Size
Box.Transparency = 0.65
end
elseif name.Name == "Head" then
local C2 = v.Character:WaitForChild("Changed2")
if C2.Value == "" then
local Box = Instance.new("SphereHandleAdornment",script.Glasses3D.Players[v.Name])
Box.Adornee = name
Box.Color3 = Color3.fromRGB(0, 153, 255)
Box.AlwaysOnTop = true
Box.ZIndex = 1
Box.Radius = 0.75
Box.Transparency = 0.65
else
local Box = Instance.new("SphereHandleAdornment",script.Glasses3D.Players[v.Name])
Box.Adornee = name
Box.Color3 = Color3.fromRGB(255, 46, 46)
Box.AlwaysOnTop = true
Box.ZIndex = 1
Box.Radius = 0.75
Box.Transparency = 0.65
end
end
end
end
end
end
--player.PlayerGui.Inventory.BG.Selected.Changed:Connect(function()
-- if player.PlayerGui.Inventory.BG.Selected.Value then
--if player.PlayerGui.Inventory.BG.Selected.Value.Name == "3DGlasses" then
-- G3D()
-- else
--for _,v in pairs(script.Glasses3D.Players:GetChildren()) do
-- v:Destroy()
-- end
--end
--else
--for _,v in pairs(script.Glasses3D.Players:GetChildren()) do
-- v:Destroy()
--end
--end
--end)
mouse.Button1Down:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Flashlight" then
if script.Parent.Value then
if script.Parent.Value.Name == "Flashlight" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
if FL == false then
FL = true
if game.Workspace.Camera.Arms.Items:FindFirstChild("Flashlight") then
if game.Workspace.Camera.Arms.Items.Flashlight.Handle.Enabled.Value == true then
print("Off")
game.Workspace.Camera.Arms.Items.Flashlight.Handle.Enabled.Value = false
script.Flashlight.On:Play()
game.Workspace.Camera.Arms.Items.Flashlight.Emitter.SpotLight.Enabled = false
game.Workspace.Camera.Arms.Items.Flashlight.Emitter.Beam.Enabled = false
game.Workspace.Camera.Arms.Items.Flashlight.Effect.SpotLight.Enabled = false
elseif game.Workspace.Camera.Arms.Items.Flashlight.Handle.Enabled.Value == false then
print("On")
game.Workspace.Camera.Arms.Items.Flashlight.Handle.Enabled.Value = true
script.Flashlight.On:Play()
game.Workspace.Camera.Arms.Items.Flashlight.Emitter.SpotLight.Enabled = true
game.Workspace.Camera.Arms.Items.Flashlight.Emitter.Beam.Enabled = true
game.Workspace.Camera.Arms.Items.Flashlight.Effect.SpotLight.Enabled = true
end
end
FL = false
end
end
end
end
end
end
end)
game.Players.LocalPlayer.PlayerGui.Medkit.Spray.MouseButton1Click:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if script.Parent.Value then
if script.Parent.Value.Name == "Medkit" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
if player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Spray.Value > 0 then
if MK1 == false then
MK1 = true
local Itemz = Arms.Items:FindFirstChild("Medkit")
Itemz.Parent = game.ReplicatedStorage
game.Players.LocalPlayer.PlayerGui.Inventory.BG.Handler.Heal.Value = true
for _,b in pairs(Arms["Right Arm"].Spray:GetChildren()) do
if b.Name == "Handle" then
else
b.Transparency = 0
end
end
Spray:Play()
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
Arms["Right Arm"].Spray.Particle.ParticleEmitter.Enabled = true
script.Medkit.Spray.Use:Play()
wait(3)
script.Medkit.Spray.Use:Stop()
script.Medkit.Spray.End:Play()
game.ReplicatedStorage.Medkit.Used:FireServer("Spray",player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Spray)
for _,b in pairs(Arms["Right Arm"].Spray:GetChildren()) do
b.Transparency = 1
end
Arms["Right Arm"].Spray.Particle.ParticleEmitter.Enabled = false
if Char.Changed2.Value == "" then
Itemz.Parent = Arms.Items
else
Itemz:Destroy()
end
game.Players.LocalPlayer.PlayerGui.Inventory.BG.Handler.Heal.Value = false
MK1 = false
end
end
end
end
end
end
end)
game.Players.LocalPlayer.PlayerGui.Medkit.Vitamins.MouseButton1Click:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Vitamins.Value > 0 then
if MK2 == false then
MK2 = true
game.ReplicatedStorage.Medkit.Used:FireServer("Vitamins",player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Vitamins)
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
wait(0.15)
MK2 = false
end
end
end
end)
game.Players.LocalPlayer.PlayerGui.Medkit.Bandage.MouseButton1Click:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if script.Parent.Value then
if script.Parent.Value.Name == "Medkit" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
if player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Bandage.Value > 0 then
if MK3 == false then
MK3 = true
local Itemz = Arms.Items:FindFirstChild("Medkit")
Itemz.Parent = game.ReplicatedStorage
game.Players.LocalPlayer.PlayerGui.Inventory.BG.Handler.Heal.Value = true
Arms["Right Arm"].Bandage.Part1.Transparency = 0
Arms["Right Arm"].Bandage.Part2.Transparency = 0
Arms["Right Arm"].Bandage.Handle.Beam.Enabled = true
Arms["Left Arm"].Bandage.Transparency = 0
script.Medkit.Bandage.Use.TimePosition = 0.21
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
Bandage:Play()
script.Medkit.Bandage.Use:Play()
wait(3)
script.Medkit.Bandage.Use.TimePosition = 0.21
script.Medkit.Bandage.Use:Stop()
script.Medkit.Bandage.End:Play()
game.ReplicatedStorage.Medkit.Used:FireServer("Bandage",player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Bandage)
Arms["Right Arm"].Bandage.Part1.Transparency = 1
Arms["Right Arm"].Bandage.Part2.Transparency = 1
Arms["Right Arm"].Bandage.Handle.Beam.Enabled = false
Arms["Left Arm"].Bandage.Transparency = 1
if Char.Changed2.Value == "" then
Itemz.Parent = Arms.Items
else
Itemz:Destroy()
end
game.Players.LocalPlayer.PlayerGui.Inventory.BG.Handler.Heal.Value = false
MK3 = false
end
end
end
end
end
end
end)
game.Players.LocalPlayer.PlayerGui.Medkit.Exit.MouseButton1Down:Connect(function()
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
end)
mouse.Button1Down:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Bat" then
if dbBat == false then
dbBat = true
BatHit:Play()
Char.Torso.Woosh:Play()
local hitt = false
script.Bat.Hit:FireServer(hitt)
wait(1)
dbBat = false
end
elseif player.PlayerGui.Inventory.BG.Selected.Value.Name == "ClaymoreExplosive" then
script.ClaymoreExplosive.Place:FireServer(game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract").PrimaryPart.CFrame)
if game.Workspace.Camera.Arms.Items:FindFirstChild("ClaymoreExplosive") then
game.Workspace.Camera.Arms.Items.ClaymoreExplosive:Destroy()
end
wait()
player.PlayerGui.Inventory.BG.NumSelected.Value = 0
player.PlayerGui.Inventory.BG.Selected.Value = nil
elseif player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if game.Players.LocalPlayer.PlayerGui.Inventory.BG.Handler.Heal.Value == false then
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = true
game.Players.LocalPlayer.PlayerGui.Medkit.Spray.Count.Text = tostring(player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Spray.Value)
game.Players.LocalPlayer.PlayerGui.Medkit.Vitamins.Count.Text = tostring(player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Vitamins.Value)
game.Players.LocalPlayer.PlayerGui.Medkit.Bandage.Count.Text = tostring(player.PlayerGui.Inventory.BG.Selected.Value.Handle.Left.Bandage.Value)
end
elseif player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlashBang" then
script.FlashBang.Place:FireServer(game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame,"Long")
if game.Workspace.Camera.Arms.Items:FindFirstChild("FlashBang") then
game.Workspace.Camera.Arms.Items.FlashBang:Destroy()
end
wait()
player.PlayerGui.Inventory.BG.NumSelected.Value = 0
player.PlayerGui.Inventory.BG.Selected.Value = nil
elseif player.PlayerGui.Inventory.BG.Selected.Value.Name == "Frag" then
script.Frag.Place:FireServer(game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame,"Long")
if game.Workspace.Camera.Arms.Items:FindFirstChild("Frag") then
game.Workspace.Camera.Arms.Items.Frag:Destroy()
end
wait()
player.PlayerGui.Inventory.BG.NumSelected.Value = 0
player.PlayerGui.Inventory.BG.Selected.Value = nil
end
end
end)
mouse.Button2Down:Connect(function()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlashBang" then
script.FlashBang.Place:FireServer(game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame,"Short")
if game.Workspace.Camera.Arms.Items:FindFirstChild("FlashBang") then
game.Workspace.Camera.Arms.Items.FlashBang:Destroy()
end
wait()
player.PlayerGui.Inventory.BG.NumSelected.Value = 0
player.PlayerGui.Inventory.BG.Selected.Value = nil
elseif player.PlayerGui.Inventory.BG.Selected.Value.Name == "Frag" then
script.Frag.Place:FireServer(game.Players.LocalPlayer.Character:FindFirstChild("Right Arm").CFrame,"Short")
if game.Workspace.Camera.Arms.Items:FindFirstChild("Frag") then
game.Workspace.Camera.Arms.Items.Frag:Destroy()
end
wait()
player.PlayerGui.Inventory.BG.NumSelected.Value = 0
player.PlayerGui.Inventory.BG.Selected.Value = nil
end
end
end)
while true do
wait()
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if MKIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Medkit" then
if MKIdle.IsPlaying == false then
MKIdle:Play()
wait()
end
else
MKIdle:Stop()
end
else
MKIdle:Stop()
end
end
else
MKIdle:Stop()
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
end
end
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "ClaymoreExplosive" then
if ClayIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "ClaymoreExplosive" then
if ClayIdle.IsPlaying == false then
ClayIdle:Play()
end
else
ClayIdle:Stop()
end
else
ClayIdle:Stop()
end
end
if game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract") then
local offset = Vector3.new(0,-2,-3.5)
game.Workspace.Interact.ClaymoreExplosiveInteract:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame*CFrame.new(offset))
else
local Show = game.ReplicatedStorage.Guns.Interact.ClaymoreExplosiveInteract:Clone()
Show.Parent = game.Workspace.Interact
end
else
ClayIdle:Stop()
if game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract") then
game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract"):Destroy()
end
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Bat" then
if BatHold.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Bat" then
if BatHold.IsPlaying == false then
BatHold:Play()
end
else
BatHold:Stop()
end
else
BatHold:Stop()
end
end
if BatIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Bat" then
BatIdle:Play()
else
BatIdle:Stop()
end
else
BatIdle:Stop()
end
end
else
BatMove:Stop()
BatIdle:Stop()
BatHold:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Shield" then
if ShieldHold.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Shield" then
if ShieldHold.IsPlaying == false then
ShieldHold:Play()
end
else
ShieldHold:Stop()
end
end
end
else
ShieldHold:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlashBang" then
if FBIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlashBang" then
if FBIdle.IsPlaying == false then
FBIdle:Play()
end
else
FBIdle:Stop()
end
end
end
else
FBIdle:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Frag" then
if FIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Frag" then
if FIdle.IsPlaying == false then
FIdle:Play()
end
else
FIdle:Stop()
end
end
end
else
FIdle:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Flashlight" then
if FLIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "Flashlight" then
if FLIdle.IsPlaying == false then
FLIdle:Play()
end
else
FLIdle:Stop()
end
end
end
else
FLIdle:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "KrazesPlushie" then
if PKIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "KrazesPlushie" then
if PKIdle.IsPlaying == false then
PKIdle:Play()
end
if script.Plushie.Music1.Playing == false then
script.Plushie.Music1:Play()
end
else
PKIdle:Stop()
script.Plushie.Music1:Stop()
end
end
end
else
PKIdle:Stop()
script.Plushie.Music1:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "3DGlasses" then
G3D()
if G3DIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "3DGlasses" then
if G3DIdle.IsPlaying == false then
G3DIdle:Play()
end
else
G3DIdle:Stop()
end
end
end
else
for _,v in pairs(script.Glasses3D.Players:GetChildren()) do
v:Destroy()
end
G3DIdle:Stop()
end
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
if player.PlayerGui.Inventory.BG.NumSelected.Value == tonumber(script.Parent.Parent.Count.Text) then
game.ReplicatedStorage.FlameThrower.Hit:FireServer(Flame)
if game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer") then
game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Flame.Enabled = false
game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Smoke.Enabled = false
end
end
end
end
if FTHold.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
if game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer") then
game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Flame.Enabled = false
game.Players.LocalPlayer.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Smoke.Enabled = false
end
if FTHold.IsPlaying == false then
FTHold:Play()
end
else
FTHold:Stop()
end
else
FTHold:Stop()
end
end
if FTIdle.IsPlaying == false then
if player.PlayerGui.Inventory.BG.Selected.Value then
if player.PlayerGui.Inventory.BG.Selected.Value.Name == "FlameThrower" then
FTIdle:Play()
else
FTIdle:Stop()
end
else
FTIdle:Stop()
end
end
else
FTMove:Stop()
FTIdle:Stop()
FTHold:Stop()
end
else
for i,v in pairs(Arms.Humanoid:GetPlayingAnimationTracks()) do
if v.Name == "Hold" or v.Name == "Walk" then
v:Stop()
end
end
BatMove:Stop()
BatIdle:Stop()
BatHold:Stop()
ClayIdle:Stop()
if game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract") then
game.Workspace.Interact:FindFirstChild("ClaymoreExplosiveInteract"):Destroy()
end
MKIdle:Stop()
game.Players.LocalPlayer.PlayerGui.Medkit.Enabled = false
ShieldHold:Stop()
FLIdle:Stop()
for _,v in pairs(script.Glasses3D.Players:GetChildren()) do
v:Destroy()
end
G3DIdle:Stop()
FBIdle:Stop()
PKIdle:Stop()
script.Plushie.Music1:Stop()
FTHold:Stop()
FTIdle:Stop()
FTMove:Stop()
Flame = false
script.FlameThrower.Activated:Stop()
end
end
that was the local script and the server sided script for the FireEvent is
local db = false
game.ReplicatedStorage.FlameThrower.Hit.OnServerEvent:Connect(function(player,Flame)
if db == false then
db = true
if Flame == true then
if player.Character.Holding:FindFirstChild("FlameThrowerServer") then
player.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Flame.Enabled = true
player.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Smoke.Enabled = true
player.Character.Holding:FindFirstChild("FlameThrowerServer").Hitbox.Touched:Connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Changed2") then
if hit.Parent:FindFirstChild("Changed2").Value == "" then
else
if Flame == true then
hit.Parent.Torso.Hit:Play()
game.Players:GetPlayerFromCharacter(hit.Parent).PlayerConfig.Health.Torso:SetAttribute("Health",game.Players:GetPlayerFromCharacter(hit.Parent).PlayerConfig.Health.Torso:GetAttribute("Health") - 1)
end
end
end
end
end)
end
else
if player.Character.Holding:FindFirstChild("FlameThrowerServer") then
player.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Flame.Enabled = false
player.Character.Holding:FindFirstChild("FlameThrowerServer").Thrower.Pos.Smoke.Enabled = false
end
end
wait(0.25)
db = false
end
end)
so the problem is that if I shoot and stop shooting it still registers that Im shooting what means if I run up into a player he dies without shooting and if I shoot at him for 1 second the damage is neutral but after 3 seconds he instantly dies
-NOTE-
Im using my own inventory and health system
I hope there is anyway to prevent from this happening thats all for today.