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

String Expected got else?

Asked by 3 years ago

Im making a opening and closing door for my game and it did not work so I checked my output and it said that here is the script.

local frame = script.Parent local openSound = frame:WaitForChild("DoorOpen") local closeSound = frame:WaitForChild("DoorClose") local clickDetector = frame:WaitForChild("ClickDetector") local model = frame.Parent local frameClose = model:WaitForChild("DoorFrameClose") local frameOpen = model:WaitForChild("DoorFrameOpen") local opened = model:WaitForChild("Opened") local tweenService = game:GetService("TweenService")

local debounce = true clickDetector.MouseClick:Connect(function() if debounce == true then debounce = false if opened.Value == true then opened.Value = false

        closeSound:Play()
        tweenService:Create(frame,TweenInfo.new(.35),{CFrame = frameClose.CFrame}):Play
 else   
            opened.Value = true

            openSound:Play()
            tweenService:Create(frame,TweenInfo.new(.35),{CFrame = frameOpen.CFrame}):Play
    end

    wait(0.35)
    debounce = true
end

end)

0
maybe cause of that :Play in line 2 and 7 Necro_las 412 — 3y

3 answers

Log in to vote
0
Answered by 3 years ago

Sorry if your having a hard time reading it because when i pasted and asked it, it did that.

Ad
Log in to vote
0
Answered by
Necro_las 412 Moderation Voter
3 years ago

maybe cause of that :Play in line 2 and 7

Log in to vote
0
Answered by 3 years ago

TweenInfo requires multiple parameters to know what you want your part to do. The following code is from this website where you can learn more about TweenInfo.

local tweenInfo = TweenInfo.new(
    2, -- Time
    Enum.EasingStyle.Linear, -- EasingStyle
    Enum.EasingDirection.Out, -- EasingDirection
    -1, -- RepeatCount (when less than zero the tween will loop indefinitely)
    true, -- Reverses (tween will reverse once reaching it's goal)
    0 -- DelayTime
)

local tween = TweenService:Create(part, tweenInfo, {Position = Vector3.new(0, 30, 0)})

Answer this question