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

Can I use Self like?

Asked by 5 years ago
Edited 5 years ago

Hey devs! I want to learn how to use Self. But nobody can anwser this question, so I make my tests.

I want to know if this goodway. ServerScript

local FixStat = 100
GameSetting:ModifCash(function(self) -- I know this can be changed by another variable
    self.TextLabel.Text = '+$'..GameSetting:ConvertShort(FixStat)
end)

ModuleScript

function ModifCash(f)
    local BillboardGui = inst('BillboardGui')
    BillboardGui.ExtentsOffsetWorldSpace = vec3(0, 5, 0)
    BillboardGui.Size = ud2(1, 0, 1, 0)
    local TextLabel = inst('TextLabel')
    TextLabel.TextColor3 = cl3(1, 1, 1)
    TextLabel.Size = ud2(1, 0, 1, 0)
    TextLabel.TextScaled = true
    TextLabel.Transparency = 1
    f(BillboardGui)
end
0
This might be of some use to you: https://www.lua.org/pil/16.html CeramicTile 847 — 5y
0
Hmmm.. I rwally have difficulty to learn self. I dont understand.. NiniBlackJackQc 1562 — 4y

Answer this question