Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with a tool that lights on fire then is removed from backpack how do I do that?

Asked by 3 years ago
Edited by Leamir 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

I have a specific tool that is removed from a players inventory when it goes in a certain area how do I make it so it lights on fire this is my script

local door = script.Parent

local function remove(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
    local player = game.Players:FindFirstChild(otherPart.Parent.Name)
    if humanoid and player then
        local inHand = otherPart.Parent:FindFirstChildWhichIsA('Tool')
        local inBackpack = player.Backpack:FindFirstChildWhichIsA('Tool')
                if inHand then
            if inHand.Name == "Tool" then

            inHand:Destroy()
        end
      end
    end
end

door.Touched:Connect(remove)

0
Working on a script for you right now! User#36898 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Add a local script in replicated script service. if you dont know how to get it. then go to the model tab, then the icon that is to gears

--Script by sabrna563
Local Tool = Game.players.localplayer.backpack:WaitForChild("ToolNameHere") --the Tool
Repeat
    Wait (0.1) --If you delete this, the server might crash
    local ToolPos = Tool.Handle.position --Gets Vecter3 Position
Until Tool = Nil --Waits until the tool is gone
Base = Instance.new("Part") --Creates a place for the fire
Base.position = ToolPos --Sets the position to where the tool was lasted used
Local Fire = instance.new("Fire") --The Fire
Fire.Parent = Base --Goes to where the base is
Base.Transperency = 0.5 --You can edit it to just 1 but its 1 so you know where the base it
Ad

Answer this question