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)
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