|
| 28 Oct 2015 03:40 PM |
Open = false Moving = false plr = game.Players.LocalPlayer allowed = require(game.ReplicatedStorage.AllowedList)
function chkAuthorized(p) for i = 1,#allowed do print(allowed[i]) if p.Name:lower() == allowed[i]:lower() then return true end end end
if chkAuthorized(plr) then script.Parent.Visible = true end
script.Parent.MouseButton1Down:connect(function() if not Open and not Moving then print('7') script.Parent.Parent.adminPanel.Visible = true print('8') Moving = true print('9') script.Parent.Parent.adminPanel:TweenPosition(UDim2.new(0.3,0,0.25,0), "Out", "Quad", 3) print('10') script.Parent.TextLabel.BackgroundColor3 = Color3.new(55/255,199/255,190/255) print('11') Moving = false print('12') Open = true print('13') end end)
script.Parent.MouseButton1Down:connect(function() if Open and not Moving then print('1') Moving = true print('2') script.Parent.Parent.adminPanel:TweenPosition(UDim2.new(-0.5,0,0.25,0), "Out", "Quad", 3) print('3') script.Parent.TextLabel.BackgroundColor3 = Color3.new(115/255,116/255,36/255) print('4') Open = false print('5') Moving = false print('6') end end)
It'll open once and it'll close. After you close it once, it just breaks. It prints everything but I can't see the GUI and it doesn't change position (I check it in build mode). Any solutions? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 28 Oct 2015 03:44 PM |
| Do you get any errors when it breaks? Press f9 while in game to check the Developer's console. It will show client-side output and server-side output. If you are doing this with a local script (as you should be) then look in the client output. |
|
|
| Report Abuse |
|
|
|
| 28 Oct 2015 03:47 PM |
No errors at all but it does print everything (the numbers) in the first MouseButton1Down event. And yes, it's a local script.
I'm assuming that it's a logic error but I don't see where I could've made a mistake in the code. |
|
|
| Report Abuse |
|
|
|
| 28 Oct 2015 03:53 PM |
Try this: script.Parent.MouseButton1Down:connect(function() if (Open and not(Moving)) then Moving = true script.Parent.Parent.adminPanel.Visible = true script.Parent.Parent.adminPanel:TweenPosition(UDim2.new(0.3,0,0.25,0), "Out", "Quad", 3) script.Parent.TextLabel.BackgroundColor3 = Color3.new(55/255,199/255,190/255) Moving = false Open = true elseif not(Open and Moving) then Moving = true script.Parent.Parent.adminPanel:TweenPosition(UDim2.new(-0.5,0,0.25,0), "Out", "Quad", 3) script.Parent.TextLabel.BackgroundColor3 = Color3.new(115/255,116/255,36/255) Moving = false Open = false end end);
Tell me if it doesn't work as I've not tested it. |
|
|
| Report Abuse |
|
|
|
| 28 Oct 2015 03:58 PM |
| Nevermind, turns out that I just had to add a wait(3) after the TweenPosition. Thanks anyway though. |
|
|
| Report Abuse |
|
|