赛派号

索菲亚全屋定制属于几线品牌 Redeem Code System

Hey developers,

Today i decide to release a very simple redeem code system ! What is redeem code ? This is a user interface, where you can type a certain code and receive a reward !

This pack include: The complete Ui design, already fully programmed All required sounds All leaderstats currency + Se The code system & programmation

File: Redeem Code.rbxl (41,5 Ko)

How to use it ?

Open the “Codes” Script in the ServerScriptService and follow the instructions. Everything is explained, easy and fast to edit. You can change the Ui placement / design how you want, just take care to don’t break the script unless you are able to edit it. :warning: It require to he the place published on a game with api enabled to access datastore se system.

Screenshots

Capture Capture1567×812 574 KB

Capture2

My other ressources

Chinese Map Sprint & Stamina

Scripts

[Update] Currency Local Script

local Player = game.Players.LocalPlayer local leaderstats = Player:WaitForChild("leaderstats" ,10) if leaderstats ~= nil then local Coins = leaderstats:WaitForChild("Coins" ,5) local Gems = leaderstats:WaitForChild("Gems" ,5) if Coins ~= nil then script.Parent.Coins.Info.Text = Coins.Value Coins.Changed:Connect(function() script.Parent.Coins.Info.Text = Coins.Value end) end if Gems ~= nil then script.Parent.Gems.Info.Text = Gems.Value Gems.Changed:Connect(function() script.Parent.Gems.Info.Text = Gems.Value end) end end

[MainScript] Code Local Script

local Player = game.Players.LocalPlayer local Codes = Player:FindFirstChild("Codes") local Button = script.Parent.Button local Frame = script.Parent.Frame local Close = Frame.Close local Redeem = Frame.Redeem local TextBox = Frame.TextBox local CodesFolder = game.ReplicatedStorage.Codes local ButtonSound = game.SoundService.Button local ErrorSound = game.SoundService.Error local RedeemSound = game.SoundService.Redeem -- Button.MouseButton1Click:Connect(function() if Frame.Visible == false then Frame.Visible = true ButtonSound:Play() elseif Frame.Visible == true then Frame.Visible = false ButtonSound:Play() end end) Close.MouseButton1Click:Connect(function() Frame.Visible = false ButtonSound:Play() end) -- local function CodeRedeemed() if Codes ~= nil and not Codes:FindFirstChild(TextBox.Text)then ButtonSound:Play() ErrorSound:Play() TextBox.Text = "" TextBox.PlaceholderText = "Invalid Code" TextBox.PlaceholderColor3 = Color3.new(1, 0.313725, 0.313725) wait(0.5) TextBox.PlaceholderText = "Type Here" TextBox.PlaceholderColor3 = Color3.new(0.698039, 0.698039, 0.698039) elseif Codes ~= nil and Codes:FindFirstChild(TextBox.Text) and Codes:FindFirstChild(TextBox.Text).Value == true then ButtonSound:Play() ErrorSound:Play() TextBox.Text = "" TextBox.PlaceholderText = "Code Already Redeemed" TextBox.PlaceholderColor3 = Color3.new(1, 0.313725, 0.313725) wait(0.5) TextBox.PlaceholderText = "Type Here" TextBox.PlaceholderColor3 = Color3.new(0.698039, 0.698039, 0.698039) elseif Codes ~= nil and Codes:FindFirstChild(TextBox.Text) and Codes:FindFirstChild(TextBox.Text).Value == false then local Event = CodesFolder:FindFirstChild(TextBox.Text) if Event ~= nil then Event:FireServer(Player) ButtonSound:Play() RedeemSound:Play() TextBox.Text = "" TextBox.PlaceholderText = "Code Redeemed" TextBox.PlaceholderColor3 = Color3.new(0.333333, 1, 0.498039) wait(0.5) TextBox.PlaceholderText = "Type Here" TextBox.PlaceholderColor3 = Color3.new(0.698039, 0.698039, 0.698039) end end end Redeem.MouseButton1Click:Connect(function() CodeRedeemed() end) TextBox.FocusLost:Connect(function(enterPressed) if enterPressed then CodeRedeemed() end end)

[Leaderstats] Currency Server Script - Create and Se

game.Players.PlayerAdded:Connect(function(Player) local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("LeaderSe") if not Player:FindFirstChild("leaderstats") then local Folder = Instance.new("Folder" ,Player) Folder.Name = "leaderstats" end local Folder = Player:WaitForChild("leaderstats" ,5) local Coins = Instance.new("IntValue",Folder) local Gems = Instance.new("IntValue",Folder) Coins.Name = "Coins" Gems.Name = "Gems" --------------------------------------------------------- local GetData = ds:GetAsync(Player.UserId) if GetData ~= nil then Coins.Value = GetData[1] Gems.Value = GetData[2] else Coins.Value = 0 Gems.Value = 0 end end) game.Players.PlayerRemoving:Connect(function(Player) local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("LeaderSe") local SeData = {} for _,Child in pairs(Player.leaderstats:GetChildren())do table.insert(SeData,Child.Value) end ds:SetAsync(Player.UserId, SeData) end)

[Codes] Codes Server Script - Create, Se and rewards

game.Players.PlayerAdded:Connect(function(Player) local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("CodesSe") if not Player:FindFirstChild("Codes") then local Folder = Instance.new("Folder" ,Player) Folder.Name = "Codes" end local Folder = Player:WaitForChild("Codes" ,5) local CodeOne = Instance.new("BoolValue",Folder) --Rename by the wanted code name local CodeTwo = Instance.new("BoolValue",Folder) --Rename by the wanted code name local CodeThree = Instance.new("BoolValue",Folder) --Rename by the wanted code name --local CodeFour = Instance.new("BoolValue",Folder) --Duplicate and rename to add another code CodeOne.Name = "CodeOne" --Rename by the created code name CodeTwo.Name = "CodeTwo" --Rename by the created code name CodeThree.Name = "CodeThree" --Rename by the created code name --CodeFour.Name = "CodeFour" --Duplicate and rename by the new added code --------------------------------------------------------- local GetData = ds:GetAsync(Player.UserId) if GetData ~= nil then CodeOne.Value = GetData[1] --Rename by the created code name CodeTwo.Value = GetData[2] --Rename by the created code name CodeThree.Value = GetData[3] --Rename by the created code name --CodeFour.Value = GetData[4] --Duplicate and rename by the new added code - Don't forget to change the number ! else CodeOne.Value = false --Rename by the created code name - let the value on "false" CodeTwo.Value = false --Rename by the created code name - let the value on "false" CodeThree.Value = false --Rename by the created code name - let the value on "false" --CodeFour.Value = false --Duplicate and rename by the new added code - let the value on "false" end end) game.Players.PlayerRemoving:Connect(function(Player) local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("CodesSe") local SeData = {} for _,Child in pairs(Player.Codes:GetChildren())do table.insert(SeData,Child.Value) end ds:SetAsync(Player.UserId, SeData) end) --------------------------------------------------------- for _, Events in pairs(game.ReplicatedStorage.Codes:GetChildren())do if Events:IsA("RemoteEvent")then Events.OnServerEvent:Connect(function(Player) local Codes = Player:FindFirstChild("Codes") local leaderstats = Player:FindFirstChild("leaderstats") if Codes ~= nil and leaderstats ~= nil then local Code = Codes:FindFirstChild(Events.Name) local Coins = leaderstats:FindFirstChild("Coins") local Gems = leaderstats:FindFirstChild("Gems") if Code ~= nil and Coins ~= nil and Gems ~= nil and Code.Value == false then Code.Value = true if Code.Name == "CodeOne" then --Rename by the created code name Coins.Value = Coins.Value + 100 --Coins reward related to this code name Gems.Value = Gems.Value + 50 --Gems reward related to this code name elseif Code.Name == "CodeTwo" then --Rename by the created code name Coins.Value = Coins.Value + 250 --Coins reward related to this code name Gems.Value = Gems.Value + 125 --Gems reward related to this code name elseif Code.Name == "CodeThree" then --Rename by the created code name Coins.Value = Coins.Value + 500 --Coins reward related to this code name Gems.Value = Gems.Value + 250 --Gems reward related to this code name -- elseif Code.Name == "CodeFour" then --Rename by the created code name -- Coins.Value = Coins.Value + 750 --Coins reward related to this code name -- Gems.Value = Gems.Value + 375 --Gems reward related to this code name end end end end) end end

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了