Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I change a TextLabel's text with a remote event? I'm having an error.

Local Script :

local player = script.Parent.Parent.order.plrName.Text
local order = script.Parent.Parent.order.order.Text

function order(plr)
	game.ReplicatedStorage.orderEvents.placeOrder:FireServer(plr, player, order)
end

script.Parent.MouseButton1Click:Connect(order) 

Server Script :

local wall = workspace.orderWall.wall

game.ReplicatedStorage.orderEvents.placeOrder.OnServerEvent:Connect(function(plr, player, order)
    local frame = script.order:Clone()
    frame.plrName.Text = player
    frame.order.Text = order
    frame.Parent = wall.SurfaceGui.list
end)

Error :

13:22:56.150 - ServerScriptService.Script:5: attempt to index nil with 'Text' 13:22:56.152 - Stack Begin 13:22:56.153 - Script 'ServerScriptService.Script', Line 5 13:22:56.154 - Stack End

2 answers

Ok im just a noob scripter, in my opinion. you need to change the local script

local player = script.Parent.Parent.order.plrName.Text
local order = script.Parent.Parent.order.order.Text

into this

local player = script.Parent.Parent.order.plrName
local order = script.Parent.Parent.order.order

its bcs in ur serverscript u write

    local frame = script.order:Clone()
    frame.plrName.TEXT= player --script.Parent.Parent.order.plrName.TEXT
    frame.order.TEXT= order --script.Parent.Parent.order.order.TEXT
    frame.Parent = wall.SurfaceGui.list

u cant write 2 TEXT in the same textlabel/texbutton ok i hope u understand wat im saying bcs im bad at english. i hope it will help u.

frame.plrName.Text = player.Name

Hope It helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.