I’m gonna be honest but the script is from a tutorial and it is supposed to pop the player’s inputted name above their head.
local Event = game:GetService(“ReplicatedStorage”):WaitForChild(“FilterMessage”)
local Input = script.Parent:WaitForChild(“InputBox”)
local Submit = script.Parent:WaitForChild(“Button”)
local Display = script.Parent:WaitForChild(“TextLabel”)
Submit.MouseButton1Down:Connect(function(buttonClicked)
local function buttonClicked()
if Input.Text ~= “” then
Event:FireServer(Input.Text)
end
end
end)
Wouldn’t that just break his script? Since he wouldn’t have the object he’s trying to find?
I don’t think that resolves anything.
It’s giving Infinite yield because the script is trying to find an object that doesn’t exist, @MapleYT12 Try fixing the location of your objects and their names.
For example: If you’re trying to get the ‘Done’ TextButton you would:
local TextButton = script.Parent.Parent.Parent.Done
I said to TRY it, if he doesn’t have the object then yes it won’t work. But I had this error recently and putting the wait in there fixed my issue so I thought it might be worthwhile for him to at least try.
Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.
You can fix this by fixing the location in the script.
Here the locations of the ‘Done’, ‘ImageLabel’, ‘Character’, ‘Name’ and TextBox I saw in your image:
local Frame = script.Parent.Parent.Parent
local Done = Frame.Done
local ImageLabel = Frame.ImageLabel
local Character = Frame.Character
local Name = script.Parent.Parent
local TextBox = script.Parent
You won’t be able to connect the MouseButton1Click to ‘Submit’ if Submit does not exist, so fix the locations and try the script.