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

how to make a gui frame biger and smaller with a button click?

Asked by
hokyboy 270 Moderation Voter
4 years ago
script.Parent.MouseButton1Click:Connect(function()
  if script.Parent.Parent.Value.Value == true then
    script.Parent.Text = "Politie?"
script.Parent.Parent.Parent.Frame.Size = UDim2.new{1, 0},{0.2, 0}
     script.Parent.Parent.desc.Visible = true
     script.Parent.Parent.join.Visible = true
    script.Parent.Parent.Value.Value = false
  else
    script.Parent.Parent.join.Visible = false
     script.Parent.Parent.desc.Visible = false
      script.Parent.Text = "Politie?"
     script.Parent.Parent.Value.Value = true
    script.Parent.Parent.Parent.Frame.Size = UDim2.new{1, 0},{0.05, 0}
  end
end)

here what i tried doesnt work can anyone help me?

0
remove the { } Arkrei 389 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

In UDim2.new you are using {} for tables , you need () and delete the { and }, Here

script.Parent.MouseButton1Click:Connect(function()
  if script.Parent.Parent.Value.Value == true then
    script.Parent.Text = "Politie?"
script.Parent.Parent.Parent.Frame.Size = UDim2.new(1, 0,0.2, 0)
     script.Parent.Parent.desc.Visible = true
     script.Parent.Parent.join.Visible = true
    script.Parent.Parent.Value.Value = false
  else
    script.Parent.Parent.join.Visible = false
     script.Parent.Parent.desc.Visible = false
      script.Parent.Text = "Politie?"
     script.Parent.Parent.Value.Value = true
    script.Parent.Parent.Parent.Frame.Size = UDim2.new(1, 0,0.05, 0)
  end
end)

Hope it works :D

0
Im blind lmaoo hokyboy 270 — 4y
Ad

Answer this question