How to give a value type to a key in a dictionary

Hello, I am trying to make a dictionary and put inside it its different keys and values, but I want to try to put in each key its respective type, but it doesn’t let me, it gives me an error.

image

I would be cordially grateful if you could help me!

I think the error arises from you trying to use type checking inside of the dictionary. I don’t really use type checking so I really don’t know if there’s a different way of accomplishing this.

local RemoteFolder:Instance = script.Parent;
local EventsFolder:Instance = RemoteFolder:FindFirstChild("Events");
local FunctionsFolder:Instance = RemoteFolder:FindFirstChild("Functions");
local Modules:{any} = {
	["events"]={
		DoBranchSkill = EventsFolder:FindFirstChild("DoBranchSkill");
	}
}

You have to define it outside of the table:

type _RemoteDictionary = {
    {RemoteEvent},
    {RemoteFunction}
}

RemoteDictionary: _RemoteDictionary = {
    -- code
}
1 Like