#Need a little help with a datastore sort of issue.
119 messages · Page 1 of 1 (latest)
@torn dome i fixed it my self, and also it was cause of what u said, there wasnt enough time
so i just did a repeat task.wait() until the profile loads
thats not a good way to do it
how would i do that?
https://github.com/Data-Oriented-House/LemonSignal/blob/main/src/init.lua
then paste inside a module script
i mean im doing this for a commision lol, wouldnt really look good to have someone elses code inside of it 😭
??
it's... a library? and that's completely normal to use
it looks worse you're asking for help than using a simple library
esp one that isnt implemented by roblox themself
i mean i fixed the problem by myself so 🤷♂️
** You are now Level 2! **
using other peoples code for the commission = true, bad
using a library? that's fine lol
ppl better than u and me use libraries all the time
ig i mean im already using the profile service library
so
does this go in a module script?
alr
name it Signal
call :Fire() somewhere with whatever arguments
and then :Connect to the instance somewhere
it works like a charm
usually i do this in the same module
im not getting what ur saying
yeah
:Fire() basically calls all the connects
yeha
it's that but u dont need an instance
u get what i mean
no bindable events
good for events in modulescripts
your datamanager is a module
put at the top somewhere DataManager.PlayerLoaded = Signal.new() (where Signal is a reference to the signal modulescript)
alr
then when the players loaded, do DataManager.PlayerLoaded:Fire(args)
then at the top of your script, instead of repeat do DataManager.PlayerLoaded:Wait()
where args is like. the player or whatever
doesnt really matter unless u plan to do an event when a player's loaded
dont think i do
but when you do :Wait() it returns the arguments passed anyway
so it would be the same as getting the player
and that's useful info
yep!
my whole save system isnt working anymore 😭
exactly like that
ohh?
perhaps put it inside the profile ~= nil
that may fix it
put where ur leaderstats create is
like after it
that should do that tho 😭
it just fires an event
like anything
and its not saving
do profile = dataManager.Profiles[plr] or dataLoader.PlayerLoaded:Wait()
only prints loaded profile
wait really?
remove the wait in the other script
doubt that'll do anything
what other script?
.
so just dataManager.PlayerLoaded?
now its erroring saying attempt to index nil with 'team' on line 27
wait actually
let me change the key to my datastore
yeah u set it to signal
do PlayerLoaded:Wait()
then at the Fire() do Fire(profile)
u get what i mean
no i dont
at the :Fire()
wait
** You are now Level 3! **
yeah i did
okay
yeah it works now
also a question
local Players = game:GetService("Players")
local SSS = game:GetService("ServerScriptService")
local dataManager = require(SSS:WaitForChild("Modules"):WaitForChild("DataManager"))
local function playerChatted(player, message)
print(player.Name .. " said: " .. message)
local splitMessage = string.split(message, " ")
if splitMessage[1] == '/wipe' then
local player = Players:FindFirstChild(splitMessage[2])
if not player then return end
local profile = dataManager.Profiles[player]
if not profile then return end
profile.Data.Team = nil
player.leaderstats.Team.Value = "Neutral"
player.Team = nil
end
end
local function playerAdded(player)
player.Chatted:Connect(function(message)
playerChatted(player, message)
end)
end
Players.PlayerAdded:Connect(playerAdded)
is there a better way to get the player messages then this 😭
not really
just put the commands in a modulescript mayhaps
function Execute would be what it does, then the name is the command name
well the thing is would this command even work if you did display name? + it would totally break actually if u did with display names with spaces
😭
prolly not
i wouldnt do displays ever
alright