#Expected ':' not '.' calling member function Create

71 messages · Page 1 of 1 (latest)

prisma flame
eternal smelt
prisma flame
eternal smelt
#

dont do .close

#

do :Close

prisma flame
#

so module:Close

#

?

eternal smelt
#

replace dots with :

#

module:CloseFrame

#

wait

#

@prisma flame

prisma flame
eternal smelt
#

can u send the module here

#

send the module

prisma flame
#

local tweenService = game:GetService("TweenService")

local mainSS = script.Parent:WaitForChild("MainSS")
local frames = mainSS:WaitForChild("Frames")

local frameOpenSpeed = 0.9
local frameCloseSpeed = 0.3

local frameOpenEasingStyle = Enum.EasingStyle.Back
local frameOpenEasingDirection = Enum.EasingDirection.Out

local frameClosingEasingStyle = Enum.EasingStyle.Bounce
local frameClosingEasingDirection = Enum.EasingDirection.Out

function module.CloseFrame(frameName)
       local frame = frames:FindFirstChild(frameName)
       if frame then
              local closeTween = tweenService.Create(frame,
                     TweenInfo.new(frameCloseSpeed, frameClosingEasingStyle, frameClosingEasingDirection),
                     {Size = UDim2.fromScale(0, 0)}
              )
              closeTween:Play()
              closeTween.Completed:Connect(function()
                     frame.Visible = false
              end)
       end
end

function module.CloseAllFrames()
       for _, frame in pairs(frames:GetChildren()) do
              if frame:IsA("Frame") then
                     coroutine.wrap(module:CloseFrame)(frame.Name)
              end
       end
end

function module.OpenFrame(frameName)
       module.CloseAllFrames()
       
       local frame = frames:FindFirstChild(frameName)
       if frame then
              frame.Size = UDim2.fromScale(0, 0)
              task.wait(frameCloseSpeed + 0.1)
              frame.Visible = true
              
              local openTween = tweenService:Create(frame,
                     TweenInfo.new(frameOpenSpeed, frameOpenEasingStyle, frameOpenEasingDirection),
                     {Size = UDim2.fromScale(1, 1)}
              )
              
              openTween:Play()
       end
end

for _, v in pairs(mainSS:GetDescendants()) do
       if v:IsA("GuiButton") then
              if v:FindFirstChild("Opens") then
                     if v:FindFirstChild("Opens").Value ~= nil then
                            v.MouseButton1Click:Connect(function()
                                   module.OpenFrame(v:FindFirstChild("Opens").Value.Name)
                            end)
                     end
              end
              if v:FindFirstChild("Closes") then
                     if v:FindFirstChild("Closes").Value ~= nil then
                            v.MouseButton1Click:Connect(function()
                                   module.CloseFrame(v:FindFirstChild("Closes").Value.Name)
                            end)
                     end
         end
    end
end

return module```
#

i saw it from a video

eternal smelt
#

oh i thought its constructor

#

wait

#

can u make one coroutine?

#

with one param

#

like

#
coroutine.wrap(module.CloseFrame)```
prisma flame
#

okay i will try it

eternal smelt
#

btw it wont even run

#

since its need to be ran by other func

#

coroutine.resume(coroutineName)

prisma flame
#

or i can do (module.CloseFrame, frame.Name)

#

?

eternal smelt
#

try

prisma flame
#

okay it works

eternal smelt
prisma flame
#

niceee

eternal smelt
#

ye

#

good

prisma flame
#

so i can't put 2 ()

#

only 1 with commas

#

k thanks

eternal smelt
#

np 😄

prisma flame
#

uh wait

#

@eternal smelt

eternal smelt
#

ye?

prisma flame
#

the frame opens but when im trying to close

#

i get the same error

#

on line 20

eternal smelt
#

AH

#

show line 20

prisma flame
eternal smelt
#

can u show more of it?

prisma flame
#

oh i think is tweenService:Create right?

#

Ok wait

eternal smelt
#

LMAO

prisma flame
eternal smelt
#

ye

#

wit

#

sec

#

yeah

#

:Create

#

xD

prisma flame
#

okay is that

#

now it closes

#

xd

#

i messed up on there

#

okay thank you so much

#

and sorry for bothing you

eternal smelt
#

I randomly joined this thread 😭

eternal smelt
prisma flame
#

xD

eternal smelt
#

i joined randomly this thread haha