You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make a status gui that changes it’s text after an amount of time i selected. -
What is the issue? Include screenshots / videos if possible!
The text changes to all the players but the problem is that it resets every time a new player joins -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have read some devforum posts and changed my code a little but nothing worked.
So like I said I am trying to make a facility status gui for a prison game but the text resets and the script runs from the start each time a new player joins. I want it not to reset. So this is a local script inside the text label:
ReplicatedStorage = game:GetService("ReplicatedStorage")
Cell = ReplicatedStorage.StatusEvents.CellBlock
Gym = ReplicatedStorage.StatusEvents.GymTime
Shower = ReplicatedStorage.StatusEvents.ShowerTime
Lunch = ReplicatedStorage.StatusEvents.LunchTime
Recreational = ReplicatedStorage.StatusEvents.Recreational
Free = ReplicatedStorage.StatusEvents.FreeTime
local CellText = "Cell Block Time"
local GymText = "Gym Time"
local ShowerText = "Shower Time"
local LunchText = "Lunch Time"
local RecreationalText = "Recreational"
local FreeText = "Free Time"
while true do
Cell:FireServer(CellText)
wait(10)
Gym:FireServer(GymText)
wait(240)
Shower:FireServer(ShowerText)
wait(240)
Lunch:FireServer(LunchText)
wait(120)
Recreational:FireServer(RecreationalText)
wait(240)
Free:FireServer(FreeText)
wait(360)
end
and this is a normal script inside the text label:
ReplicatedStorage = game:GetService("ReplicatedStorage")
Cell = ReplicatedStorage.StatusEvents.CellBlock
Gym = ReplicatedStorage.StatusEvents.GymTime
Shower = ReplicatedStorage.StatusEvents.ShowerTime
Lunch = ReplicatedStorage.StatusEvents.LunchTime
Recreational = ReplicatedStorage.StatusEvents.Recreational
Free = ReplicatedStorage.StatusEvents.FreeTime
local function Cell2()
Cell.OnServerEvent:Connect(function(player, text1)
script.Parent.Text = text1
end)
end
local function Gym2()
Gym.OnServerEvent:Connect(function(player, text2)
script.Parent.Text = text2
end)
end
local function Shower2()
Shower.OnServerEvent:Connect(function(player, text3)
script.Parent.Text = text3
end)
end
local function Free2()
Free.OnServerEvent:Connect(function(player, text6)
script.Parent.Text = text6
end)
end
local function Recreational2()
Recreational.OnServerEvent:Connect(function(player, text5)
script.Parent.Text = text5
end)
end
local function Lunch2()
Lunch.OnServerEvent:Connect(function(player, text4)
script.Parent.Text = text4
end)
end
Gym2()
Cell2()
Shower2()
Free2()
Recreational2()
Lunch2()
Sorry if i made some mistakes. I am new to scripting and this is my first devforum post . Any help is appreciated.