? wrote a code ( one of my firsts) to animate a button :
local FE = "e" local object = script.Parent local Player = game.Players.LocalPlayer local Character = Player.Character while script.Parent.Parent.Parent.Visible == true do if game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode[FE] then object = guiObject:TweenSize(0, 85, 0, 85) end end
as you can see theres 2 ends cause if ? put one it gives Players.gjlkv1.PlayerGui.ScreenGui.ImageLabel.Frame.ImageButton.ImageButton.Loc:10: Expected 'end' (to close 'function' at line 7), got <eof> if ? put 2 it gives Players.gjlkv1.PlayerGui.ScreenGui.ImageLabel.Frame.ImageButton.ImageButton.Loc:11: Expected ')' (to close '(' at line 7), got <eof> so having a little problem where to put them help please?
Add an end) at the end of the script Here is a complete script
local FE = "e" local object = script.Parent local Player = game.Players.LocalPlayer local Character = Player.Character while script.Parent.Parent.Parent.Visible == true do if game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent) then -- why do you have if statement here if it is wrong then delete then and if, and delete end at the end if inputObject.KeyCode == Enum.KeyCode[FE] then object = guiObject:TweenSize(0, 85, 0, 85) end end)
Your script looks fine, except you should have three ends at the end of the code, not two. Just like this:
local FE = "e" local object = script.Parent local Player = game.Players.LocalPlayer local Character = Player.Character while script.Parent.Parent.Parent.Visible == true do if game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent) then if inputObject.KeyCode == Enum.KeyCode[FE] then object = guiObject:TweenSize(0, 85, 0, 85) end end end