Information:
THIS QUESTION HAS BEEN SOLVED
Script:
wait() while true do wait() if script.Parent.Position == UDim2.new(1,0,0.907,0) then -- Players.Dave_Robertson.PlayerGui.MapButton.ImageLabel.LocalScript:4: attempt to index nil with 'Position' script.Parent:Destroy() else script.Parent.Position = script.Parent.Parent.TextButton.Position end end
Try this out.
local MapButton = script:FindFirstAncestor("MapButton") local ImageLabel = MapButton:FindFirstChildOfClass("ImageLabel") while true do wait() if ImageLabel.Position == UDim2.new(1,0,.907,0) then ImageLabel:Destroy() break else ImageLabel.Position = MapButton.TextButton.Position end end
You have an unnecessary while true do
loop here. The loop will destroy your ImageLabel
after first or second iteration. Hence the error.
Unfortunately it is unclear to me what you are trying to achieve, so I can't really help you more.