Custom Hotbar (help)

I’m making a hotbar like Spector, but how would I go around equipping items without tools, I may try welding the item, detecting clicks and stuff using local scripts and remotes.

3 Likes

I may not be an expert in this area, but I did a little research, and I think I found something that might help you: How to make Pseudotools (UPDATED). Hope this works for you!

2 Likes

weld the tool to the left/right arm with a motor6d
its the same as a weld but you can adjust the rotation and position easier to customize grips and also for animation

and detect clicks with localscripts and remotes

1 Like

AshEnigma and Happya, thank you for both of you responses I would set you bot h as solution if I could have two, thank you so much

@happya_x,

What would be the best way to put the script in the Gui or PlayerScripts what would be better

welding should be on the server

click detection is on the client in playerscripts probably

Either would work but PlayerScripts might work better.

Okay. Thank you all for your help

Wait, I have one more question if I’m making a gun and a melee how should I do that and have one handler, like check what type the tool is then call the gun module if not a gun then melee module

make one handler that checks an attribute like tool:GetAttribute("weaponType") and then use the gun or melee module depending on that

1 Like

Thank you so much, but could I check the name

I know this may not quite be what you’re looking for so I don’t want to completely derail your question, but for future reference it is possible to disable the default backpack UI

You could then continue to use the standard tool instance as per-usual with your custom hotbar UI being an interface for equipped / unequipping.

Wow, you had the same thought as me. I gave up a little because I could use tools and detect with modules like what the fake tools used a little

And EgoMoose how did you find this post, dont you make really good games?

@EgoMoose, I need help I have a script that will check when a item is added to the character, checks what type it is like a tool check a module that is a dictionary that has primary, secondary, melee is that good and a folder called Weapon_Modules that has all the modules for the weaoibs

Yooo, didn’t expect to see my post here! Thanks for linking it for OP. To address OP, I’ve definitely done some refining in my pseudotool craft. Here are some tips you may find useful:

  • I’ve come to realise that for all tools that I create, it’s really useful to put a module script inside them called settings (I mostly work with guns). This is basically just a frozen table containing useful metadata regarding the tool

Example:

local settings = {
    firerate = 0.15
    clip = 30
    ammoType = "Light"
}

return table.freeze(settings)

Now you can just require this module script somewhere within your main handler to access any tool info. Just a different approach as to attributes suggested by @happya_x.

  • While my newer tutorial has improved greatly in terms of security as opposed to my older one, I still believe it is relatively insecure. Make sure you sanity check any information handled by the client. An example would be in my case where I use a custom pseudotool system to handle weapons in my FPS game. As the game is single-player, bullets are handled on the client. However, sanity checks are run on the origin point of the bullet to ensure it isn’t too far from the muzzle of the gun. Sanity checks like these help further secure your game from exploiters, so make sure important data that affects other users’ gameplay is handled or checked by the server.

Sorry for pinging who I did, I just wanted to drop in and provide some feedback in case OP decides to implement a pseudotool system.