There’s certainly a lot of options, if you are not familiar with maybe ViewportFrames
, or you find it difficult managing animations or physically creating and displaying the character or skin then the best bet for you is an animated UI function of sort.
This is an exceptionally easy method of displaying rewarded information, you could possibly:
Once you’ve successfully verified they can afford the product, and have subducted the crates price, (and of course, got the rarity, you can use a basic math.random()
function if you want an easy workaround), you can return your RemoteFunction
with a unique success parameter, I’d suggest just return true
works fine, as we are handling all our important features on the server, this does not need anything special.
You can detect this invoke by the following method:
local CrateFunction = --RemoteFunction instance here
local CrateInvoke = CrateFunction:InvokeServer(CRATE)
if CrateInvoke.hasSucceeded then --.hasSucceeded is NOT built in, we returned it in a table prior
-- we could handle this better but for efficiency purposes we'll presume nothing went wrong
end
From here, I presume you understand making basic UI animations, if not I can send a few tutorials, otherwise, we can format our animation as the following:
if CrateInvoke.hasSucceeded then
local UnlockedCharacterName = CrateInvoke.CharacterName --NOT BUILT IN, we returned it
local UnlockedCharacterRarity = CrateInvoke.CharacterRarity --NOT BUILT IN, we returned it
doUIAnimation(UnlockedCharacterName, UnlockedCharacterRarity)
end
If you do not understand RemoteFunctions, or some of my wording does not make sense, I can send you over a quick game-file which will have all the code.