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

Why does nothing happen in my Equipped event?

Asked by
Jexpler 63
5 years ago

I have this incredibly simple script:

local tool = script.Parent
tool.Equipped:connect(function(mouse)
    print("Test")
end)

For some reason nothing gets printed when I equip the tool. Why?

0
Use this in a LocalScript please cringe_worthey 97 — 5y
0
And you should use :Connect instead of :connect which is deprecated. InfernoExeuctioner 126 — 5y
0
@InfernoExeuctioner What is the difference between :Connect and :connect ??? Nep_Ryker 131 — 5y
0
connect is deprecated, and Connect isn't. Although alot of people say that connect shouldn't be used, you can still use them, it's that it's not recommended to use cringe_worthey 97 — 5y
View all comments (2 more)
0
Do you have a handle in the tool? If not then check the needhandle property inside the tool. frederikhome 44 — 5y
0
actually it's deprecated because roblox is very personal with PascalCase SulaymanArafat 230 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

Hello,

The reason your code doesn't work is because :connect() is deprecated use :Connect() instead.

Here is the fixed code:

local tool = script.Parent
script.Parent.Equipped:Connect(function()
    print('Test')
end)

~Frag

Ad

Answer this question