local player = game.Players.LocalPlayer
local OpenRemoteEvent = game.ReplicatedStorage:FindFirstChild("OpenFinishGui")
local FinishGui = player.PlayerGui.FinishGui.FinishGui
OpenRemoteEvent.OnClientEvent:Connect(function(text)
FinishGui.ObbyName.Name.Text = text
end)
I have this script and it is suppose to change a text in a gui when a event is fired. It doesn't work and it gives me a error: Workspace.NOLIFE_DEV.OpenFinishGui:7: attempt to index string with 'Text' . Is there any correction I need to make in my script?
Any help will be appriciated!
(This is the fire event script: [It has some other stuff like open the gui)
local prompt = script.Parent
local open = false
prompt.Triggered:Connect(function(player)
local PlayerGui = player:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui.FinishGui.FinishGui
if open == false then
local OpenGui = game.ReplicatedStorage:FindFirstChild("OpenFinishGui")
open = true
OpenGui:FireAllClients("World 1 - Easy Obby")
ScreenGui.Visible = true
else
open = false
ScreenGui.Visible = false
end
end)

2 comments
ObbyName is a textlabel and I am trying to change the text of the label
Yeah so do ObbyName.Text = text