LocalScript in Tool Does Not Run At All

There seems to have been something wrong with the new game I created to develop the knife in, I have no idea if it was a ROBLOX problem or not as the game had never been edited in before.

I am working on a knife for my upcoming game, however, the local script does not function at all, as if it didn’t exist within the tool.

To test if the script was working I added print("whatever was going on at this part in the script") even on the very first line, but nothing shows up in the output, whether or not the tool is equipped.

The script is not disabled and no other scripts are disabling it as I have created a separate empty base-plate just to create this weapon.

Any help on how to solve this would be wonderful. I have attached the script itself and screenshots of the tool’s and handle’s properties.

Local Script

print("Working")
wait()
print("About to start")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local Character = Player.Character

print("1: Got Player and Character")

repeat wait() until Character ~= nil or Player.CharacterAdded:Wait() or 
game.Workspace:FindFirstChild(Player.Name)

print("2: Found Character")

local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local PlayingAnimation = nil

print("3: Got the Tool")

local Activated = false
local Equipped = false
local CanUse = false

print("4: Set Tool Values")

local StartTick = tick()
local ActiveTick = tick()

local Mouse = Player:GetMouse()

print("5: Got Mouse")

local Animations = {
    Charge = {
	    Animation = Character.Humanoid:LoadAnimation(script.Parent:WaitForChild("Charge")),
	    Duration = 1.5
    },
    ChargeHold = {
	    Animation = 
Character.Humanoid:LoadAnimation(script.Parent:WaitForChild("ChargeHold"))
    },
    Slash1 = {
	    Animation = Character.Humanoid:LoadAnimation(script.Parent:WaitForChild("Slash1")),
	    Duration = 0.6
    },
    Slash2 = {
	    Animation = Character.Humanoid:LoadAnimation(script.Parent:WaitForChild("Slash2")),
	    Duration = 0.6
    }
}

print("6: Created Animations Table")

Tool.Equipped:Connect(function()
    print("Equipped Started")
    Equipped = true
    CanUse = true
    print("Equipped Complete")
end)

Screen Shots
Tool Contents in StarterPack
ToolContents
Tool Properties
ToolProperties
Tool Handle Properties
ToolHandleProperties

I have tried disabling and re-enabling different things, and still no function form the script.

1 Like

I have had an issue similar to this but mine was not with the tool.
Anyways I think it’s because you have a plugin causing that or maybe the place you are working in just broke. Try again tomorrow to see if it works.

1 Like

All of the plugins I have haven’t affected any tools I made for my other games, so I’ll keep trying to fix it, but ultimately if I can’t get a good answer for this problem then I’ll check back in on it tomrrow.

Make sure that the tool goes to the backpack at first. Equip it and see if those print lines executes. If yes then it is an error in the script if no have a look if they script is still in the tool from the players backpack and if the script is there then idk

1 Like

Is there other people you work with that probably is messing with it not on purpose.

2 Likes

@maxen2031 there are no errors and the script is in the tool once it is in the player’s backpack.

@vikenmanoukian21 I am a solo developer, no one else has access.

Also I got my tool working now, I guess there was something wrong with the place I opened to start developing the knife, as now that I opened up another game to develop the knife in it seems to have started working. I wonder why that is as the place it wasn’t working was brand new and had no previous edits to it.

2 Likes