Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BTServer (Server)
- local tool = script.Parent
- local handle = tool.Handle
- local isBurningRemote = Instance.new("RemoteEvent")
- isBurningRemote.Name = "isBurningRemote"
- isBurningRemote.Parent = tool
- local isOnRemote = Instance.new("RemoteEvent")
- isOnRemote.Name = "isOnRemote"
- isOnRemote.Parent = tool
- local isOffRemote = Instance.new("RemoteEvent")
- isOffRemote.Name = "isOffRemote"
- isOffRemote.Parent = tool
- local isOn = false
- local flameBrick = tool.FlameBrick
- local flame = tool.FlameBrick.ParticleEmitter
- local light = tool.FlameBrick.SpotLight
- local trigger = tool.Trigger
- local targetFire = tool.BTFire
- function activateWeld(a)
- if a:IsA("BasePart") then
- local x, y = tool.Handle, a
- local w = Instance.new("Weld")
- w.Part0 = x
- w.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- w.C0 = C0
- w.C1 = C1
- w.Parent = x
- a.Anchored = false
- else
- local c = a:GetChildren()
- for i = 1, #c do
- activateWeld(c[i])
- end
- end
- end
- function ignite(val)
- light.Enabled = val
- flame.Enabled = val
- isOn = val
- end
- tool.isBurningRemote.OnServerEvent:Connect(function()
- trigger.Touched:Connect(function(hit)
- if isOn then
- local human = hit.Parent:FindFirstChildOfClass("Humanoid")
- if human and not hit:FindFirstChild("BTFire") then
- local c = targetFire:Clone()
- c.Parent = hit
- for i = human.MaxHealth, 0, -human.MaxHealth * 0.10 do
- --print(i)
- human.Health = i
- wait(human.Health * 0.005)
- end
- print(human.Parent.Name.." died from a blowtorch!")
- end
- human = nil
- end
- end)
- end)
- tool.isOnRemote.OnServerEvent:Connect(function()
- ignite(true)
- end)
- tool.isOffRemote.OnServerEvent:Connect(function()
- ignite(false)
- end)
- function weld()
- activateWeld(tool)
- end
- tool.Equipped:Connect(weld)
- tool.Unequipped:Connect(weld)
- weld()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement