Ok, so I'm working on a (kind of) overpowered tool. But for some reason, the tool isn't working it is displaying with the error message
Tool:Activate() called from script when tool is not equipped. Tool will not be activated.
even when the tool is equipped. This warning should only happen when the tool isn't equipped...
Code for the tool:
local UIS = game:GetService("UserInputService")
local action = ""
local hum = script.Parent.Parent.Parent.Character.Humanoid
local tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse()
UIS.InputBegan:Connect(function(input, istyping)
local action
if not istyping and input.KeyCode == Enum.KeyCode.X then
action = "Teleport"
tool:Activate()
elseif input.KeyCode == Enum.KeyCode.R then
action = "Donut"
tool:Activate()
elseif input.KeyCode == Enum.KeyCode.V then
action = "KC"
tool:Activate()
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
action = "Punch"
tool:Activate()
end
end)
tool.Activated:Connect(function()
print(action)
if action == "Teleport" then
hum.Parent:MoveTo(mouse.Hit.Position)
end
end)
