Hey, I am trying to do a similar system like many games with pets that give out multipliers , so I want to make a weapon ( is not something you can actually use) that works as something that gives a boost for example like 5x more gems when a specific thing is done.
Here is a script from a click detector where I tried making the multiplier into :
function onMouseClick(Player)
local clickDetector = script.parent --example of the click detector
local getMultiplier
function getMultiplier(Player, Multiplier1)
local Multi = 0
for i,v in pairs(Player.Multipliers:GetChildren()) do
if v.Equipped.Value == true then
Multi = Multi + v[Multiplier1].Value -- where it should be getting the value of the multiplier
local Amount = game.ServerStorage.Amount.Value * Multi
--where it should add it into the calculations.
Player.leaderstats.Gems.Value = Player.leaderstats.Gems.Value + Amount
end
end
return Multi
clickDetector.MouseClick:connect(onMouseClick)