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

I can't identify this error on the end of the function?(ANSWERED)

Asked by
emervise 123
3 years ago
Edited 3 years ago

I'll put my full script for context, but the place it gives me an error is on the block about the on button. (line 58) Here is my error:

08:59:35.582 - ServerScriptService.MicrowaveScript:58: Expected identifier when parsing expression, got ')'

local onButton = game.Workspace.Microwave.Buttons.OnButton
local offButton = game.Workspace.Microwave.Buttons.OffButton
local openButton = game.Workspace.Microwave.Buttons.OpenButton
local closeButton = game.Workspace.Microwave.Buttons.CloseButton
local door = game.Workspace.Microwave.TweeningDoor
local wheel = game.Workspace.Microwave.LazySusan
local base = game.Workspace.Microwave.Base
local motor = base.MicrowaveMotor
local light = game.Workspace.Microwave.Light
local doorOpen = false
local microwaveOn = false
local tweenCooldown = false

local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(
    1,
    Enum.EasingStyle.Sine,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local tweenGoals = {
    Position = Vector3.new(-49.623, 8.5, 5.443);
    Orientation = Vector3.new(0, -15, 0);
}
local openDoorTween = TweenService:Create(door, Info, tweenGoals)

local Info2 = TweenInfo.new(
    1,
    Enum.EasingStyle.Sine,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local tweenGoals2 = {
    Position = Vector3.new(-43, 8.5, 15.5);
    Orientation = Vector3.new(0, 90, 0);
}
local closeDoorTween = TweenService:Create(door, Info2, tweenGoals2)



openButton.ClickDetector.MouseClick:Connect(function()
    if doorOpen == true then
        warn("error")
    else if tweenCooldown == true then
            warn("cooldown")
        else if microwaveOn == false then
            tweenCooldown = true
            doorOpen = true
            openDoorTween:Play()
            wait(3)
            tweenCooldown = false
        end
    end
end)

closeButton.ClickDetector.MouseClick:Connect(function()
    if doorOpen == false then
        warn("error")
    else if tweenCooldown == true then
            warn("cooldown")
        else
            tweenCooldown = true
            doorOpen = false
            closeDoorTween:Play()
            wait(3)
            tweenCooldown = false
        end
    end
end)

onButton.ClickDetector.MouseClick:Connect(function()
    if doorOpen = true then
        warn("error")
    else
        light.PointLight.Enabled = true
        motor.AngularVelocity = 0.5
    end
end)

onButton.ClickDetector.MouseClick:Connect(function()
        light.PointLight.Enabled = false
    motor.AngularVelocity = 0
2
remove the end on line 56 or 57 Amiaa16 3227 — 3y
0
yup he is right VerdommeMan 1479 — 3y
0
Ty emervise 123 — 3y
0
now i get this tho 09:31:24.499 - ServerScriptService.MicrowaveScript:87: Expected 'end' (to close 'function' at line 45), got <eof>; did you forget to close 'function' at line 84? emervise 123 — 3y
0
fixed emervise 123 — 3y

Answer this question