Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

what is wrong with this gui script?

Asked by 9 years ago
function goLeft()
    script.Disabled = false
    wait(.5)
    script.Parent.Parent.Right.Visible = false
    for i = 1,56  do
        script.Parent.Parent.CustomClass1.Position = script.Parent.Parent.CustomClass1.Position - Udim2.new(-.25, 0, 0, 0)
    Script.Parent.Parent.CustomClass1.Visible = false
    script.Parent.Parent.CustomClass2.Visible = true
    script.Parent.Parent.CustomClass2.Position = Udim.new(15, 0, 1.5, 0)
    for i = 1, 48 do
        script.Parent.Parent.CustomClass2.Position = script.Parent.Parent.CustomClass1.Position - Udim2.new( -.25, 0, 0, 0)
    end
    script.Parent.Visible = false
        end 
    script.Disabled = true
end
script.Parent.MouseButton1Down:connect(goLeft)

it says "Players.Player1.PlayerGui.ScreenGui.CustomClass.Left.Script:6: attempt to index global 'Udim2' (a nil value)" also for some reason it wont let me click it, i made the transparency 1 if that matters also, its a text button, all my other text buttons are clickable but not this one any idea why?

2 answers

Log in to vote
0
Answered by
MrFlimsy 345 Moderation Voter
9 years ago

Udim2.new should be UDim2.new (note the capital D).

0
Ok, I'll try that namelessassasin 30 — 9y
0
But is there anything else wrong with the script? namelessassasin 30 — 9y
0
That's all I can see. If it's still not working, copy/paste the output here. MrFlimsy 345 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

First, as MRFlimsy wrote, Udim2.new should be UDim2.new ; and in line 9 you wrote Udim.new, where it must be UDim2.new

Hope this helps,

mranderson11

Answer this question