Its a custom donate button (Gui) The money system doesnot work with a leaderstats. I really don't know the problem. Money location ServerStorage.MoneyStorage(Player, Name) its a value as playername Whats wrong at this now? Thanks to everyone that helps!

wait(2)

toBox = script.Parent.ToPlayer
amountBox = script.Parent.amount
plr = game.Players.LocalPlayer
yer = game.ServerStorage
tie = plr.Name

script.Parent.Donate.MouseButton1Click:connect(function()
	toName = toBox.Text
	amount = tonumber(amountBox.Text)
	if game.Players:FindFirstChild(toName) then
		yer:FindFirstChild(toName)
		if plr.tie.Value>=amount and amount>0 and amount<1001 then
			plr.tie.Value = plr.tie.Value-amount
			yer.tie.Value = yer.tie.Value+amount
		end
	end	
end)

3 comments

0

Are you using Berezaa's tycoon kit? (Guessing from the whole ServerStorage.MoneyStorage)

0

yes

0

Are their any errors in your script?