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

OnEqiupped script not workins despite no errors?

Asked by 5 years ago

Basically this is a normal script inside of a tool, it is very basic and should work, but it dosent, I don't get anything printed in the output, signifying it has not worked. but there are no error in the entire script, please help!

local Tool = script.Parent
local function OnEquipped(mouse)
print("Eqiupped")
end

Tool.Equipped:connect(OnEquipped)

local function OnUnequipped()
print("UnEqiupped") 
end
Tool.Unequipped:connect(OnUnequipped)

0
I ran the script in roblox studio and there was no issues, do you have a part named "Handle"? XxPatriotFinitexX 1 — 5y

1 answer

Log in to vote
1
Answered by
AltNature 169
5 years ago

Lowercase "C" in ":connect" is deprecated so change the C of ":connect" to uppercase so it becomes :Connect

also you dont need local function

local Tool = script.Parent
function OnEquipped(mouse)
print("Eqiupped")
end

Tool.Equipped:Connect(OnEquipped)

function OnUnequipped()
print("UnEqiupped") 
end
Tool.Unequipped:Connect(OnUnequipped)
Ad

Answer this question