u fail mr wiener
local randomfactor = 23 -- change this to any number you want, but dont do math.random() or anything. this is to make it harder for people to hack their own money.
function onChatted(msg, recipient, speaker)
local id = speaker.userId
if string.sub(msg, 1, 6) == "load/ " then
local code = tonumber(string.sub(msg, 7))
local money = code / id / randomfactor
speaker:findFirstChild("leaderstats"):findFirstChild("Money").Value = money
end
if string.sub(msg, 1, 6) == "save/ " then
local code = id * speaker:findFirstChild("leaderstats"):findFirstChild("Money").Value * randomfactor
local m = Instance.new("Hint")
m.Parent = speaker
m.Text = "Your code is: " .. code
end
end
function onEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, speaker) end)
end
game.Players.ChildAdded:connect(onEntered) |