Hello, I’m trying to make a system that will get a text from a JSON and enter it into a text label, I’ve been using a remote event to fire on all clients. Here is the script:
Server:
local Remote = game.ReplicatedStorage.RemoteEvent
local HttpService = game:GetService("HttpService")
local URL_MESSAGE = "****/messageIt.json"
local response = HttpService:GetAsync(URL_MESSAGE)
local data = HttpService:JSONDecode(response)
print(data.message)
wait(3)
Remote:FireClient(data)
Local:
local Frame = script.Parent.Frame
local Label = Frame.TextLabel
local Remote = game.ReplicatedStorage.RemoteEvent
Remote.OnClientEvent:Connect(function(data)
print("Executing")
Label.Text = data.message
end)
local Remote = game.ReplicatedStorage.RemoteEvent
local HttpService = game:GetService("HttpService")
local URL_MESSAGE = "****/messageIt.json"
local response = HttpService:GetAsync(URL_MESSAGE)
local data = HttpService:JSONDecode(response)
print(data.message)
wait(3)
Remote:FireClient(data.message)
Local:
local Frame = script.Parent.Frame
local Label = Frame.TextLabel
local Remote = game.ReplicatedStorage.RemoteEvent
Remote.OnClientEvent:Connect(function(data)
print("Executing")
Label.Text = data
end)
local Frame = script.Parent.Frame
local Label = Frame.TextLabel
local Remote = game.ReplicatedStorage.RemoteEvent
Remote.OnClientEvent:Connect(function(data)
print(data)
print(data.message)
print("Executing")
Label.Text = data
end)