I am currently working on a game, where you have to transfer a currency into Coins. I do not want the exact amount to transfer. I want half of that to transfer. Help! Heres the script it currently just transfers everything:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + plr.leaderstats.Squeaks.Value
plr.leaderstats.Squeaks.Value = 0
end
end)

2 comments
Well, you would cut the currency in half using amount / 2, and setting the coins value to that.
All you have to do is add /2 at the end of line 4 after plr.leaderstats.Squeaks.Value, so it only adds half.