Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --leaderstats
- game.Players.PlayerAdded:Connect(function(Player)
- local leaderstats = Instance.new("Folder",Player)
- leaderstats.Name = "leaderstats"
- local Cash = Instance.new("NumberValue",leaderstats)
- Cash.Name = "Cash"
- Cash.Value = 0
- end)
- --CodeServer
- local RemoteEvent = game.ReplicatedStorage.CodeEvent
- RemoteEvent.OnServerEvent:Connect(function(Player,Reward,Code)
- if Player:FindFirstChild(Code) == nil then
- local Redeemed = Instance.new("BoolValue", Player)
- Redeemed.Name = Code
- Redeemed.Value = false
- if Redeemed.Value == false then
- Player.leaderstats.Cash.Value += Reward
- Redeemed.Value = true
- end
- end
- end)
- --CodeClient
- local Codes = {"Comment","Like","Subscribe"} --Change to Code names and keep make how much you want
- local RemoteEvent = game.ReplicatedStorage.CodeEvent
- script.Parent.EnterButton.MouseButton1Click:Connect(function()
- if script.Parent.InputBox.Text == Codes[1] then
- RemoteEvent:FireServer("100",Codes[1]) --Price for fist Code
- else
- if script.Parent.InputBox.Text == Codes[2] then
- RemoteEvent:FireServer("200",Codes[2]) --Price for second Code
- else
- if script.Parent.InputBox.Text == Codes[3] then
- RemoteEvent:FireServer(300,Codes[3]) --Price For Third Code
- end
- end
- end
- end)
- --Close Script
- script.Parent.MouseButton1Click:Connect(function()
- script.Parent.Parent.Parent.Frame.Visible = false
- end)
- --OpenScript
- script.Parent.MouseButton1Click:Connect(function()
- script.Parent.Parent.Parent.CodeGui.Frame.Visible = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement