How to tell when a player has a tool in their hand

Hello, I havent really ever worked with tools in roblox and I’m trying to code one. I’m trying to make the tool give a coin multiplier and jump height multiplier but to do this I need to be able to tell when the player has the balloon in their hand. I have a module script with all the balloons stats inside it. Does anybody know how you can do this?

local balloons = {
	["Basic"] = {
		Power = 16;
		CoinMulti = 1;
	},
	["Star"] = {
		Power = 22;
		CoinMulti = 1.5;
	}
}

return balloons

You can use the Equip function to detect when a player has a tool in the hand.

Local Tool = mytool

Tool.Equipped:Connect(Function()

— put what ever you want to happen when you equip the tool

End)

1 Like

Oh sweet thanks, and that can be in a local script?

Yes it can. I would recommend it directly in the tool to make it easier.

I’ll play around with it and see what works easier for me since there’s a bunch of different balloons they have.

You can either use [ToolName].Equipped:Connect() or you can check if there’s a tool inside of the workspace player. Every other tool will be stored in their player in game.Players.

3 Likes

You can use these as well

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.