#Tool.Equipped broken

28 messages · Page 1 of 1 (latest)

stuck berry
#

Why is tool.Equipped execute when I'm not with the tool equipped. It just exec when I start the game. Why is it happening?

limber flume
stuck berry
#

I thought that too. Sadly, still not working

limber flume
stuck berry
#

yeah

#

it just executes, even if my tool is not equipped

inner schoonerBOT
#

studio** You are now Level 1! **studio

stuck berry
#

I have no idea why

hollow rampart
#
  1. You need to connect and disconnect the .Equipped event connection when the tool is unequipped, it's important to check if the tool is in the character with a cool down before you execute any other code.

  2. You forgot that in the UIS function you can't check for .Equipped, because that's an event, not a Boolean, instead check if the tool is inside a character as I said before.

west plank
stuck berry
#

@west plank ignore these new variables, it's for another thing.

hollow rampart
#

Again, .Equipped is an Event that fires whenever the player equips the tool, you use that event as a function connection (or with the connection itself) to check if the player is equipping the tool.

local isToolEqupieed
Tool.Equipped:connect(function()
isToolEqupieed = true
-- code
end)

Tool.Unequipped:connec(function()
isToolEqupieed = false

You have also ignored the second thing I mentioned, which is checking if the tool is being equipped by the character, which can be more efficient because you don't use any events:
local isToolEquipped = (Tool.Parent == Player.Character) and true or false.

#

@stuck berry

west plank
#

before being smart can you make sure you spell stuff right

hollow rampart
west plank
#

oh

#

you wrote that on mobile?

hollow rampart
#

Yes everything I write is on mobile

west plank
#

thats very impressive

#

discord mobile sucks

hollow rampart
#

I'm fully agree

#

Even with plugins it barely benefits.

stuck berry
#

Sorry for the long time to reply. I'm on my way to home. As soon I get there I'll try what u said @hollow rampart

stuck berry