ReplicatedStorage not working

Good day developer

What do you want to achieve?
live weather readback to ui

What is the issue?
i tried for a hour always same result
image

ServerScriptService’s server scipt

local httpService = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local weather = ReplicatedStorage:WaitForChild("weather")
local weatherv = ReplicatedStorage:WaitForChild("weatherv")

local requestOptions = {
	Url = "http://api.openweathermap.org/data/2.5/weather?id=" .. 
		"" .. --city deleted
		"&apikey=" ..
		""; --deleted api key
		Method = "GET";
}

local function kelvinsToFahrenheit(temp)
	return math.floor(((temp * 9/5 - 459.67) - 32) * 5/9)
end

local function windkots(speed)
	return math.floor(speed * 1.944)
end

local function windd(deg)
	return math.floor(deg)
end

local windknots = windkots(tonumber(responseBodyTable.wind.speed))
local winddeg = windd(tonumber(responseBodyTable.wind.deg))
local temperature = kelvinsToFahrenheit(tonumber(responseBodyTable.main.temp))

weatherv.OnServerEvent:Connect(function(Players, Value)
	if Value == 1 then
		weather:FireClient(windknots, winddeg, temperature)
	end
end)

StarterGui’s localscript

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local weather = ReplicatedStorage:WaitForChild("weather")
local weatherv = ReplicatedStorage:WaitForChild("weatherv")

script.Parent.Parent.Parent.Choose.Value.Changed:Connect(function()
	if script.Parent.Parent.Parent.Choose.Value.Value == 1 then
		weatherv:FireServer(value)
	end
	
	if script.Parent.Parent.Parent.Choose.Value.Value == 2 then
		weatherv:FireServer(value)
	end
end)

weather.OnClientEvent:Connect(function(Players, windknows, winddeg, temperature)
	print(windknots, winddeg, temperature)
end)

also add in server scirpt

print("Wind speed:", tostring(windknots) .. "kts")
print("Wind direction:", tostring(winddeg) .. "degrees")
print("Temperature:", tostring(temperature) .. "°C")

successful readback
image

so i think the problem on

weatherv.OnServerEvent:Connect(function(Players, Value)
	if Value == 1 then
		weather:FireClient(windknots, winddeg, temperature)
	end
end)

thank for your patience to read

You’re not passing the player back to the client. Try the following:

weatherv.OnServerEvent:Connect(function(Players, Value)
	if Value == 1 then
		weather:FireClient(Players, windknots, winddeg, temperature)
	end
end)

(might also be better to rename it to player just for readability purposes but it’s fine as is.)

thank youuu it working But I have a bug again I’ll fix it later ah
image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.