So I have a TextLabel that displays text when RemoteEvent is fired. If someone steps on a part the whole server will see a message appear.

The text label displays StringValue, The value is placed in ReplicatedStorage, but I cant access that from the server.

So what I need is - player steps on a part and it fires a remote event and changes the Value to some text. Then local script displays the value.

ServerScript

script.Parent.Touched:Connect(function()
	game.ReplicatedStorage.Text.Value = "Hello World" 
	game.ReplicatedStorage.TextEvent:FireAllClients()
end)

LocalScript

local storage = game:GetService("ReplicatedStorage")
local event = storage:WaitForChild("TextEvent")
local text = storage:WaitForChild("Text")
local TextLabel = script.Parent:WaitForChild("TextLabel")

function Type()
local TypeString1 = text.Value
for Character = 1,#TypeString1 do
TextLabel.Text = TypeString1:sub(1,Character)
wait(.1)
end 
end


event.OnClientEvent:Connect(Type)

Output

Text is not a valid member of ReplicatedStorage

2 comments

1

Why don't you just use the event to send a message to everyone instead of sending the event to tell players to check the value?

0

I'm pretty sure the server can access ReplicatedStorage as well. Otherwise, how can you do :FireAllClients() with a RemoteEvent that's in ReplicatedStorage?