Working On Learning Some Basic table and loops

Hello! im working on learning some basic table and loops. I want a project idea that would teach me some of this stuff im kinda clueless on ideas tho thanks for any suggestions

1 Like

Hmm… Idk man, try making a Local script that gets every instance in DataModel (game:GetDescendants()), and checks if it’s name longer than 4 symbols and it’s descendant of Workspace, and it needs to be a Part. If it is, then destroy it.

It’s simple as hell but i don’t have any ideas in my mind bro :person_shrugging:

Wait, I have an better idea now.

rn im working on a lil shop type thing

1 Like

So, you can try getting all the parts in workspace (with GetDescendants() again), and make the player humanoid walk to it.

ive alr kinda done that ElipsGames's Place: 05062024_1 - Roblox

Sorry can’t join the place rn.

Maybe should I try to come up with something complex?

np it spawns fruits randomly and there are multiple players, the players slowly eat the food and if they dont they get starved out

sure that sounds good please do

Okay, so, try to make a simple Shop GUI (I’ve seen you’ve messaged before that you did some shop thingy), and add something simple as a Cola, Sprite, etc, etc… But! The thing that is to buy a Cola for example, you need to play 5 minutes minimum. How do you know how much the player spend a time in your game? Try making a leaderboard with a time the player spent in your time (Hint: Make a leaderstats folder (On the server!) inside a player, then make a NumberValue and name it whatever you want. (For example — Coins)).

Price list:
Cola - 5 minutes,
Sprite - 10 minutes
Etc - go up with something yourself…

There is also a limit on how much you can buy.

Limits:
Cola - 1 time maximum,
Sprite - 4 times maximum.
Etc - etc…

When a player bought a cola, or another drink, it should be gave to the players hands (character).

I don’t know if that’s complex to you, but that’s a easy/mid for me.

Did I at least explained it well…? Because my main language is not English.

i should be able to do this i worked on this but it dont work
wait(0.2)
local AppleTable = {10, “AppleBought”, “MMTasty”}
local BlueBerryTable = {10, “BlueBerryBought”, “MMTasty”}
local BlackBerryTable = {10, “BlackBerryBought”, “MMTasty”}
local StrawBerryTable = {10, “StrawberryBought”, “MMTasty”}
local BuyButton = script.Parent
local Money = game.Players.ElipsGames.leaderstats.Money
BuyButton.Touched:Connect(function(T)
if T.Name == “Apple” then
print(“Apple”)
Money -= AppleTable[1]
print(AppleTable[2], AppleTable[3])
end
if T.Name == “BlueBerry” then
Money -= BlueBerryTable[1]
print(BlueBerryTable[2], BlueBerryTable[3])
end
if T.Name == “BlackBerry” then
Money -= BlackBerryTable[1]
print(BlueBerryTable[2], BlackBerryTable[3])
end
if T.Name == “StrawBerry” then
Money -= StrawBerryTable[1]
print(StrawBerryTable[2], StrawBerryTable[3])
end
end)

i get this 15:45:15.803 Workspace.Part.Script:23: attempt to perform arithmetic (sub) on Instance and number - Server - Script:23

i forgot to put the .Value after the money

Why is that

Wow yeah i understood that only thing is with the limmits it would just be cola - 1 maximum you dont need the time

i gtg thanks for the help! this rly helped

Sorry my phone just turned off because my battery died. Goodbye :ok_hand::saluting_face:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.