Don’t really know how to summarize my problem in the topic name, so here we are.
Let’s say I make metatable:
local Arena = {}
Arena.__index = Arena
and after that I set a metatable to a player:
local function AddProfile(Player)
if Player then
local NewProfile = {
Weapon = {
[1] = {
Name = "Glock";
Ammo = 120;
};
[2] = {
Name = "Hand";
Ammo = 0;
};
};
}
setmetatable(NewProfile, Arena)
Arena.Profiles[Player] = NewProfile
end
end
This profile is used across different scripts.
So what I want to achieve is, how do I make the script listen to when mathematical operations are used in the profile, and run a function. I don’t seem to see a metamethod that does this…
Basically an event that runs when you add/subtract ammo in one of the weapons. Any help is appreciated!