What does this error mean?

Error message: image

Code: image

1 Like

Use boundkeyholder.Changed:Connect(UpdateKey)

When you use boundkeyholder.Changed:Connect(UpdateKey()) you are calling the function instead of connecting it to that event

1 Like

That worked thanks. Thanks for your help. :slight_smile:

1 Like

@DevConX

Small pro tip.

I see what you are trying to do here, and a few small things you could to make your life easier.

This script must exist inside of your object that you are tracking in some way. Instead of seeking out your values like Do as follows.

→ Create a centralized module at an easy top level access point. Think like highest level in your interface or within player-scripts something easy to seek. Replicated is always a good choice for this.

→ Require this module and have the local player or who ever or whatever you need ref for these objects too should register with the module. When they “register” you have a custom indexed object table for accessors to things like Crouch value and any other one you want to do or grouping values.

Now anything that you want to read that data, or write to that data, just needs to ref that easy to access module and just use a proper signature for it. So if its player, you could index using the player object itself, but i think you should only do that under special cases. I would advise use the UserId as the accessing point.

Now if this only applies to local player, than just have a module that is part of player initilization that does all this. And then use the same concept.

This will keep you from having to play the script.parent.parent.parent game. Which can be hard to read or properly decern where things are and be hard to be maintained. Just some helpful tips.