View difference between Paste ID: WW0Xfy9z and S7HXRM3k
SHOW: | | - or go back to the newest paste.
1
local remotes = game.ReplicatedStorage.Remotes
2
local httpService = game:GetService("HttpService")
3
local replicatedStorage = game.ReplicatedStorage
4
local remotes = replicatedStorage:WaitForChild("Remotes")
5
local createTemplate = remotes:WaitForChild("CreateTemplate")
6
7
8
local codes = {
9
    ["PLAY"] = {
10
        function(player)
11
            player.leaderstats.Diamonds.Value += 100000
12
        end,
13
        false
14
    },
15
    ["PET"] = {
16
        function(player)
17
            local petName = "18"
18
            local id = httpService:GenerateGUID()
19
            local pet = Instance.new("StringValue", player.Pets)
20
            pet.Name = petName
21
            pet.Value = id
22
            createTemplate:FireClient(player, petName, id)
23
        end,
24
        false
25
    },
26
}
27
28
29
remotes:WaitForChild("UseCode").OnServerInvoke = function(player,code)
30
    if codes[tostring(code)] then
31
        if player.Codes then
32
            if type(codes) == "table" then
33
                if player.Codes:FindFirstChild(tostring(code)) then
34
                    return "Already"
35
                else
36
                    if codes[tostring(code)][2] == true then
37
                        return "Expired"
38
                    else
39
                        codes[tostring(code)][1](player)
40
                        local usedCode = Instance.new("StringValue", player.Codes)
41
                        usedCode.Name = tostring(code)
42
                        return "Successfully"
43
                    end
44
                end
45
            else
46
                return "Unknown"
47
            end
48
        else
49
            return "Unknown"
50
        end
51
    else
52
        return "Invalid"
53
    end
54
end
55