I made a system that when you buy a 2x multiplier it gives you 2x scarap(the currency were working with)
workspace.collectables:WaitForChild("PartA").ClickDetector.MouseClick:Connect
(function(player) -- this function argument is at the end of the line above
local ValA = player.Val.Value
if ValA == 0 then
player.scrap.Value = player.scrap.Value + Mval
elseif ValA == 1 then
player.scrap.Value = player.scrap.Value + Tval
end
end)
and the button that increases the number values code is
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.Val.Value == 0 then
game.Players.LocalPlayer.Val.Value = game.Players.LocalPlayer.Val.Value + 1
end
end)
that is a local script

5 comments
the script works when i change it while im in edit mode
am i crazzy
Make ALL changes to the server. Not to the client. If you make changes to the client, the exploiters can have a field day with your code.
Any errors? Try debugging.
And don't change the values via a local script as @Dovydas1118 said. Use remote events to fire to the server, and handle the addition there.