Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this not saving the text in a datastore?

I have a server script:

local ds = game:GetService("DataStoreService")
local record = ds:GetDataStore("Records")
game.ReplicatedStorage.save.OnServerEvent:Connect(function(sender, target, message)
	print("fired, "..sender.name.." to "..target.name.." message is "..message)
	local frame = game.StarterGui.Record.Frame
	local success, errormessage = pcall(function()
	record:SetAsync(target.userId, message)
	end)
	if success then
			frame.save.Text = "Succsesfully sent!"
	else
		print("that aint it chief")
		warn("here is the error "..errormessage)
	end
end)

1 answer

Lua is Case Sensitive, so you need to have the proper naming of your properties.

Change Line 7 to

record:SetAsync(target.UserId, message)

and change Line 5 to

local frame = target.PlayerGui.Record.Frame

This discussion is preserved as it was. New answers, comments, and votes are closed.