Information:
THIS QUESTION HAS BEEN SOLVED
Script:
1 | wait() |
2 | while true do |
3 | wait() |
4 | if script.Parent.Position = = UDim 2. new( 1 , 0 , 0.907 , 0 ) then -- Players.Dave_Robertson.PlayerGui.MapButton.ImageLabel.LocalScript:4: attempt to index nil with 'Position' |
5 | script.Parent:Destroy() |
6 | else |
7 | script.Parent.Position = script.Parent.Parent.TextButton.Position |
8 | end |
9 | end |
Try this out.
01 | local MapButton = script:FindFirstAncestor( "MapButton" ) |
02 | local ImageLabel = MapButton:FindFirstChildOfClass( "ImageLabel" ) |
03 |
04 | while true do |
05 | wait() |
06 | if ImageLabel.Position = = UDim 2. new( 1 , 0 ,. 907 , 0 ) then |
07 | ImageLabel:Destroy() |
08 | break |
09 | else |
10 | ImageLabel.Position = MapButton.TextButton.Position |
11 | end |
12 | 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.