#Hello im new someone help plz
38 messages · Page 1 of 1 (latest)
Can someone help me plz
I followed this guy's yt tutorial
Today we're starting a new series on how to create a Simulator on Roblox in 2022! We'll go through all the systems of a modern simulator and recreate each individual one!
Subscribe for more Roblox Scripting Tutorials!
Join my Patreon to support me and gain access to the Scripts in this video! https://www.patreon.com/MonzterDEV
Get the Profile...
And I got this
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local Template = require (ServerScriptService.PlayerData.Template)
local Manager = require (ServerScriptService.PlayerData.Manager)
local ProfileService = require (ServerScriptService.Libs.ProfileService)
local ProfileStore = ProfileService.GetProfileStore("Production", Template)
local KICKMESSAGE = "Data issue, try again shortly. If issue persists, contact us!"
local function CreateLeaderstats(player: Player)
local profile = Manager.Profiles[Player]
if not profile then return end
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local clicks = Instance.new("NumberValue", leaderstats)
clicks.Name = "Clicks"
clicks.Value = profile.Data.Clicks
local gems = Instance.new("NumberValue", leaderstats)
gems.Name = "Gems"
gems.Value = profile.Data.Gems
end
local function LoadProfile(player: Player)
local profile = ProfileStore:LoadProfileAsync("Player"..player.UserId)
if not profile then
player:Kick(KICK_MESSAGE)
return
end
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
Manager.Profiles[player] = nil
player:Kick(KICKMESSAGE)
end)
if player:IsDescendantOf(Players) == true then
Manager.Profiles[player] = profile
CreateLeaderstats(player)
else
profile:Release()
end
end
for , player in Player:GetPlayers() do
task.spawn(LoadProfile, player)
end
Players.PlayerAdded:Connect(LoadProfile)
Players.PlayersRemoving:Connect(function)player)
local profile = Manager.Profiles[player]
if profile then
Profile:Release()
end
end
There's something wrong with it but idk where or what or why
Should I give up?
It would be easier to find the problem if you add the output
Woah
** You are now Level 1! **
What is an output?
just watch a tutorial on how to learn lua before trying to follow a yt tutorial on how to make a simlutaion game
** You are now Level 1! **
There's a comma after for just above the very bottom. But it would indeed be useful if you could send us the error message (or output).
nd this is what it's supposed to look like
OR MAYBE it has something to do with manager or template?
** You are now Level 2! **
Could you click on "View" and "Output" while testing? This will show us if the code has any problems while running!
Woahhh
Thanks so much!!!
What should I do now?
Whoops nevermind
At the end of your code you (accidentally) typed an ")" this is probably the cause of your problem. Simply change the last part of you code to this: ```lua
Players.PlayerAdded:Connect(LoadProfile)
Players.PlayersRemoving:Connect(function)player
local profile = Manager.Profiles[player]
if profile then
Profile:Release()
end
end
Or just remove the ")" after player on line 55.
@fleet dock
Ooh thank you!, I'm testing it rn
Actually, I think adding a "(" before player, and ")" after it should work.
** You are now Level 3! **
So this:
Players.PlayerAdded:Connect(LoadProfile)
Players.PlayersRemoving:Connect(function(player)
local profile = Manager.Profiles[player]
if profile then
Profile:Release()
end
end
oohh okk I'll try that too!
Wierd, I pasted it in but the leaderboard doesn't display "Gems" or "Clicks" like in the guy's yt video
I think I'll try again tomorrow. It's 3:09 on a school night and I got an exam tomorrow 💀