Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help, when I do “Paging ” .. Department the department wont show Help?

Asked by 2 years ago
Edited 2 years ago

Hello there everyone. I am having a slight issue. I am making a paging system for a hospital I own. I am on the very last step to get this working. But when I run the OnAllClients to show the GUI for everyone, the text label dose not show the information I want it to.

I have checked the Department and Location string value in game and they are both the correct information. But when the script is done running, the text label only shows Paging to

Here is the script:

local Event = game:GetService("ReplicatedStorage"):WaitForChild("Event")
local textLabel = script.Parent
local Player = game:GetService('Players').LocalPlayer
local Department = Player.PagingSystem.Frame.WhoToPageButtons.Pt1.Value
local Location = Player.PlayerGui.PagingSystem.Frame.Location.Value.Value



local Pt1 = Department
local Pt2 = Location





Event.OnClientEvent:Connect(function()
    textLabel.Text = "Paging " .. Department .. "to " .. Location
end)

1 answer

Log in to vote
0
Answered by 2 years ago

Your variables are defined when you define them, they aren't constantly updated. Make sure to use just the necessary values, or, make a variable when the client event is fired.

local Event = game:GetService("ReplicatedStorage"):WaitForChild("Event")
local textLabel = script.Parent
local Player = game:GetService('Players').LocalPlayer


local Pt1 = Department
local Pt2 = Location


Event.OnClientEvent:Connect(function()

    local Department = Player.PagingSystem.Frame.WhoToPageButtons.Pt1.Value
    local Location = Player.PlayerGui.PagingSystem.Frame.Location.Value.Value
    textLabel.Text = "Paging " .. Department .. "to " .. Location

end)
Ad

Answer this question