#Expected ':' not '.' calling member function Create
71 messages · Page 1 of 1 (latest)
coroutines requires 2 ()?
yes?
wtf since when
replace dots with :
module:CloseFrame
wait
@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
oh i thought its constructor
wait
can u make one coroutine?
with one param
like
coroutine.wrap(module.CloseFrame)```
okay i will try it
btw it wont even run
since its need to be ran by other func
coroutine.resume(coroutineName)
try
okay it works
ohh
niceee
np 😄
ye?
can u show more of it?
okay is that
now it closes
xd
i messed up on there
okay thank you so much
and sorry for bothing you
I randomly joined this thread 😭
nah its okay xD
xD
i joined randomly this thread haha