КАК СДЕЛАТЬ СИМУЛЯТОР В ROBLOX STUDIO!(Скрипты в описание)

10.08.2021
Leaderstats Script: game.Players.PlayerAdded:Connect(function(p) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Parent = p local money = Instance.new("IntValue") money.Name = "Likes" money.Value = 0 money.Parent = stats local money = Instance.new("IntValue") money.Name = "Rebirths" money.Value = 0 money.Parent = stats end) ClickButton script: local plr = game.Players.LocalPlayer local db = false script.Parent.MouseButton1Click:Connect(function() if db == false then plr.leaderstats.Likes.Value = plr.leaderstats.Likes.Value + 1 +plr.leaderstats.Rebirths.Value script.Click:Play() db = true wait(0.2) db = false end end) Rebirth Button Script: script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.Frame.Visible == false then script.Parent.Parent.Frame.Visible = true else script.Parent.Parent.Frame.Visible = false end end) Покупка Rebirths скрипт: local plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if plr.leaderstats.Likes.Value = 50 then -- поставьте перед ровно знак больше workspace.Script.Rebirth1:FireServer(plr) plr.leaderstats.Likes.Value = 0 end Script WorckSpace RemoteEvent: script.Rebirth1.OnServerEvent:Connect(function(plr) plr.leaderstats.Rebirths.Value = plr.leaderstats.Rebirths.Value + 1 end) script.Rebirth2.OnServerEvent:Connect(function(plr) plr.leaderstats.Rebirths.Value = plr.leaderstats.Rebirths.Value + 5 end) script.Rebirth3.OnServerEvent:Connect(function(plr) plr.leaderstats.Rebirths.Value = plr.leaderstats.Rebirths.Value + 10 end) end) SaveData Script: local DS = game:GetService("DataStoreService"):GetDataStore("SaveMyData") game.Players.PlayerAdded:Connect(function(plr) wait() local plrkey = "id_"..plr.userId local savevalue = plr.leaderstats.Likes local GetSaved = DS:GetAsync(plrkey) if GetSaved then savevalue.Value = GetSaved[1] else local NumbersForSaving = {savevalue.Value} DS:GetAsync(plrkey, NumbersForSaving) end end) game.Players.PlayerRemoving:Connect(function(plr) DS:SetAsync("id_"..plr.userId, {plr.leaderstats.Likes.Value}) end) Ссылка на эту игру: https://www.roblox.com/games/7232142866/Like-Simulator

Похожие видео

Показать еще