You have 2 problems in your script.
- You changed gui what located in starterGui. You need to change playersGui, but here is another problem. You cant access players gui from default script if you turned on filtering. You need to use remote events for it
- You put "else" on wrong line.
Also I fixed your script. Here is it
For first insert a script in ServerScriptService and type this
local Event = Instance.new("RemoteEvent")
Event.Parent = game:GetService("ReplicatedStorage")
Event.Name = "TestEvent"
local Month = 0
local Day = 0
local Sea = 0
Event:FireAllClients("M"..Month)
while true do
if Month == 12 then
Month = Month - 11
else
Month = Month + 1
end
end
Now insert localscript into StarterGui and type this...
local Event = game:GetService("ReplicatedStorage"):WaitForChild("TestEvent")
local player = game:GetService("Players").LocalPlayer
local GUI = player.PlayerGui.Season
local Text = GUI.SeasonText.Text
Event.OnClientEvent:Connect(function(Message)
Text = Message
end)
I hope you understand.
1 comment
what script is it?