Trying to make a Shout out System for Chatbox and I can't seem to figure out how to see if the DataStore has been updated with new Values?
local Datastore = game.ReplicatedStorage:WaitForChild("Datastore")
local DS = game:GetService("DataStoreService"):GetDataStore("ShoutData")
local DoneShout = false
local data2 = Datastore:InvokeServer("Get",nil)
local empty = {
Subject = "",
Player = "",}
empty.Subject = "Testing Hello Test2"
empty.Player = "Kuzx"
table.insert(data2,1,empty)
table.remove(data2,250)
Datastore:InvokeServer("Set",data2)
while wait(5) do
local data = Datastore:InvokeServer("Get",nil)
for i,v in pairs(data) do
if DoneShout == false then
DoneShout = true
local message = Instance.new("StringValue")
message.Value = "[Shout] "..v.Player..": "..v.Subject
local check = Instance.new("BoolValue",message)
wait(0.5)
message.Parent = script.Parent.ServerMessage
end
end
DoneShout = false
end
This is only a short code I try to write to see if the Message is being sent, Now I just need help with getting a function to run the Shout. Any ideas or pointing out some hints would be great
I did try to use OnUpdate but this is only when a value is being updated so this doesn't help me when I'm trying to add a Value to the DataStore and updating it to the Chatbox.
