The script is returning a table instead of a string. What am i doing wrong?
module script:
local Ask = {}
Ask.Bind = Instance.new("BindableFunction")
function Ask.Prompt(Question)
if game.Players.LocalPlayer.PlayerGui:FindFirstChild("AskUI") then
game.Players.LocalPlayer.PlayerGui.AskUI:Destroy()
end
ui = script.AskUI:Clone()
ui.Ask.TextLabel.Text = Question --<<this turns the text into a table somehow>>--
script.Woosh:Play()
ui.Parent = game.Players.LocalPlayer.PlayerGui
ui.Ask:TweenPosition(UDim2.new(0.392, 0,-0.06, 0), "Out", "Back", script.Woosh.TimeLength, false)
ui.Ask.No.MouseButton1Click:Connect(function()
Ask.Bind:Invoke("No")
script.Woosh:Play()
ui.Ask:TweenPosition(UDim2.new(0.392, 0,-0.192, 0), "In", "Back", script.Woosh.TimeLength, false)
wait(script.Woosh.TimeLength)
ui:Destroy()
end)
ui.Ask.Yes.MouseButton1Click:Connect(function()
Ask.Bind:Invoke("Yes")
script.Woosh:Play()
ui.Ask:TweenPosition(UDim2.new(0.392, 0,-0.192, 0), "In", "Back", script.Woosh.TimeLength, false)
wait(script.Woosh.TimeLength)
ui:Destroy()
end)
end
return Ask
local script:
local ask = require(game.ReplicatedFirst.LocalModules.Ask)
ask.Bind.OnInvoke = function(returned)
if returned == "Yes" then
print("Yes")
elseif returned == "No" then
print("No")
end
end
ask:Prompt("Test") --<<here is the problem>>--

3 comments
what exactly is "Test" being turned into
Calling a modular function with : will return the first argument as self. You need to account for that in your modules function like you would with calling a remote from the client and getting its player back as the first argument... function Ask.Prompt(Self, Question)
or, you could just replace the ":" with "." at line 11 of your LocalScript to call the function without passing the first argument as "self" (as it would if the function were a method that you call with ":")