Why is the text not displayed?

maybe you can help me. I want the text in the textbox from line 5 (—Here—) to be the same text like reason which is importet.
Thank you for your Help.

script.Parent.Parent.Parent.Parent.Events.MessageEvent.OnServerEvent:Connect(function(player, input, reasen)
local players = game:GetService("Players")
local player = player[input]

player.PlayerGui.Info.Message.Textfeld.Text = ---Here---
player.PlayerGui.Info.Message.Textfeld.TextScaled = true
player.PlayerGui.Info.Message.Visible = true
player.PlayerGui.Info.Message.Visible = false



You can’t change GUI on the server.
edit: apparently you can

Like this?

player.PlayerGui.Info.Message.Textfeld.Text = reason

@Pokemoncraft5290 You can, if you access it through PlayerGui

Yeah, that’s what I mean. The text should be the same as the reason.

Change “reasen” to “reason” so it works with @lluckvy’s code.

    local Players = game:GetService("Players")
    local inputtedPlayer = Players:FindFirstChild(input)
    local PlayerGui = inputtedPlayer:WaitForChild('PlayerGui')

    PlayerGui.Info.Message.Textfeld.Text = reason
    PlayerGui.Info.Message.Textfeld.TextScaled = true
    PlayerGui.Info.Message.Visible = true
    PlayerGui.Info.Message.Visible = false
1 Like

Ive tried your script. I have the error: (string wxpected, got nil)
The error is in line 6

What line is the error on? aaa

Is the textbox named “Textfeld”? Or “Textfield”

Make sure #3 parameter reason is defined isn’t empty

1 Like

Think I found the bug. reason is not imported correctly.
Could you give me an example of how I could do this ?

Its a Textbox

MessageEvent:FireServer(input, reason)

1 Like

Thank you very much for your help. I found the error. I forgot to give the :FireServer the textbox for the reason.

1 Like