When I run it in Run mode on Studio, I get this error:
Players.Player1.PlayerGui.HUD.Civilian.Buttons.LocalScript:15: attempt to call method 'MouseButton1Click' (a userdata value)
Additionally, I'm also getting this error:
Players.Player1.PlayerGui.HUD.Civilian.Buttons.LocalScript', Line 15
Here's the code:
plr = game.Players.LocalPlayer
---------------------------------------------------------
while true do
plr.PlayerGui.HUD.Civilian.Buttons.Notifications.Button:MouseButton1Click():connect(function()
if script.NotifActivated == false
then
plr.PlayerGui.HUD.Notifications:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",2,true)
if script.NotifActivated == true
then
plr.PlayerGui.HUD.Notifications:TweenPosition(UDim2.new(1,0,0,0),"Out","Linear",2,true)
script.NotifActivated = false
end
end
end)
end
And, here's a picture of my GUI hierarchy: http://prntscr.com/7qbord
The code is meant to check if "NotifActivated" is checked, and if it is, the Notifications bar is meant to slide into place. If it isn't, it is meant to slide out.
Thanks in advance for any help!
Edit: Formatting

1 comment
For future reference, please make your title relevant to the issues at hand (whether it be the problem or type of script). It helps us help you!