Unnecessary Script Error in Studio

My script is showing an error that is not really a valid error to show up. The first image is shown when i hover over the errored line. The second image is the error im getting.

image

script.Parent.ChildAdded:Connect(function()
    for i , v in pairs(script.Parent:GetChildren()) do
        if v:IsA("ImageButton") then
            script.Parent.Parent:FindFirstChild("Limit").Text = "wow"
        end
    end    
end)

This the script for it and i have everything in the correct location as show in the image below.
image

The things i want to know :

  1. Is this a studio bug and should I reinstall studio.
  2. Is there any problem in my script.
2 Likes

Greetings, I just tried to run it in my own plate and it seems to be working fine, maybe there is another script that changes stuffs of the GUI?

1 Like

if its working for you it might be the problem of my studio and the error is coming on the script i showed.

Try doing this:

wait(2)

script.Parent.Parent:FindFirstChild("Limit").Text = "wow"

removing everything else, and see if it gives you an error

Are you using type checking? If you are try adding --!nonstrict at the very top of the script to disable it because it has some bugs that cause problems like this.

i am not using type check and i have send the full script of it. Ima try to reinstall studio

1 Like

The script is working now thanks, but this line is showing a warning and the image below is what you see when i hover over it.
image

I think that’s probably because when doing FindFirstChild, it doesn’t know what Class the Instance is, hence why it’s saying it couldn’t find Text since all it knows is that Limit is an Instance.

Edit: If you would like to get rid of that error, you could just remove the FindFirstChild and reference Limit normally, but that would probably cause issues for your script

1 Like

Thank you for that piece of info , I really appreciate it :smiley: :+1:

Anytime! If you have any more issues don’t be afraid to make a post about it!!

1 Like