I am trying to learn new things , but I hate it when I get stuck on things that most likely have a small fix basically, I am trying to get a multipliers from some pets folder and add that to the points giving.
local ClickDetector = script.parent
function onMouseClick(Player)
-- Here should be the rest of the script , but it has nothing to do with this topic.
-------------------------
function getMultiplier(Player, Multiplier1)
local Multi = 1
for i,v in pairs(Player.Pets:GetChildren()) do
if v.Equipped.Value == true then
Multi = Multi + v[Multiplier1].Value
end
end
return Multi
end
local Multiplier1 = getMultiplier()
local pointsamount = game.ServerStorage.Points.Value * Multiplier1()-trying to get the Multi from the function.
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value + pointsamount
clickDetector.MouseClick:connect(onMouseClick, getMultiplier)