#Hello im new someone help plz

38 messages · Page 1 of 1 (latest)

fleet dock
#

yea

#

Can someone help me plz

#

I followed this guy's yt tutorial

#

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?

warm root
fleet dock
#

Woah

desert swallowBOT
#

studio** You are now Level 1! **studio

fleet dock
#

What is an output?

raw creek
#

just watch a tutorial on how to learn lua before trying to follow a yt tutorial on how to make a simlutaion game

desert swallowBOT
#

studio** You are now Level 1! **studio

craggy magnet
fleet dock
#

ohhh

#

hmm hold on

fleet dock
fleet dock
#

OR MAYBE it has something to do with manager or template?

desert swallowBOT
#

studio** You are now Level 2! **studio

craggy magnet
#

Could you click on "View" and "Output" while testing? This will show us if the code has any problems while running!

fleet dock
#

Woahhh

fleet dock
#

What should I do now?

craggy magnet
#

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

fleet dock
craggy magnet
#

Actually, I think adding a "(" before player, and ")" after it should work.

desert swallowBOT
#

studio** You are now Level 3! **studio

craggy magnet
#

So this:

Players.PlayerAdded:Connect(LoadProfile)
Players.PlayersRemoving:Connect(function(player)
local profile = Manager.Profiles[player]
if profile then
    Profile:Release()
end
end
fleet dock
#

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 💀