How to make a SIMULATOR DOOR | Roblox Studio

Опубликовано: 31 Март 2024
на канале: Itz_FloppyFish
8,326
394

In todays video I show you how to make a simulator world door, this is often seen inside simulators, these systems are used to block off other worlds, making players have to purchase access to these areas using in-game currency. So..... if you did want this type of system in your game make sure to watch to the end of the video to find out how!

I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!

Create your own coin tutorial:    • How to make a COIN SYSTEM | Roblox St...  

Script 1 (Main DataSaving Script):

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local DatastoreService = game:GetService("DataStoreService")
local Data = DatastoreService:GetDataStore("11")
local sessionData = {}

function PlayerAdded(player)
local Coins = Instance.new("NumberValue")
Coins.Name = "Coins" -- Change Coins to whatever your currency is called.
Coins.Parent = player

local Gate = Instance.new("NumberValue")
Gate.Name = "Gate" -- Change Gate to whatever you want your Hidden Stat to be called.
Gate.Parent = player

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local Hiddenleaderstats = Instance.new("Folder")
Hiddenleaderstats.Name = "Hiddenleaderstats"
Hiddenleaderstats.Parent = player


Coins.Parent = leaderstats
Gate.Parent = Hiddenleaderstats

local success, playerData = pcall(function()
return Data:GetAsync(player.UserId)
end)

if success then
print("Data loaded: " .. player.Name)

if not playerData then
print("New player, giving default data")

playerData = {
["Coins"] = 0, -- Change Coins to whatever your currency is called.
["Gate"] = 0,
}
end

sessionData[player.UserId] = playerData
else
warn("Couldn't load data: " .. player.Name)
player:Kick("Couldn't load your data, rejoin")
end

Coins.Value = sessionData[player.UserId].Coins -- Change Deaths to whatever your currency is
Gate.Value = sessionData[player.UserId].Gate

Coins:GetPropertyChangedSignal("Value"):Connect(function()
sessionData[player.UserId].Coins = Coins.Value -- Change Deaths to whatever your currency is
end)

Gate:GetPropertyChangedSignal("Value"):Connect(function()
sessionData[player.UserId].Gate = Gate.Value
end)
end

Players.PlayerAdded:Connect(PlayerAdded)

function PlayerLeaving(player)

if sessionData[player.UserId] then

local success, errorMsg = pcall(function()
Data:SetAsync(player.UserId, sessionData[player.UserId])
end)

if success then
print("Data saved: " .. player.Name)
else
warn("Can't save: " .. player.Name)
end
end
end

Players.PlayerRemoving:Connect(PlayerLeaving)

function ServerShutdown()
if RunService:IsStudio() then
return
end


for _, player in ipairs(Players:GetPlayers()) do
task.spawn(function()
PlayerLeaving(player)
end)
end
end

game:BindToClose(ServerShutdown)
-----------------------------
All other scripts are located in the pinned comments (I reached description word limit!)
----------------------------------------

If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!

NEW! Floppys Obby Game : https://www.roblox.com/games/14917960...

Floppys Simulator Game: https://www.roblox.com/games/13963457...

If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!

🌟 Floppys Discord Server:   / discord  
🌟 Floppys Roblox Game : https://www.roblox.com/games/11301003...

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials


Смотрите видео How to make a SIMULATOR DOOR | Roblox Studio онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Itz_FloppyFish 31 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8,326 раз и оно понравилось 394 людям.