Today's Summary: playerstats (or leaderstats), is a special folder created inside the player instance which will contain IntValues or other values which will be displayed as a table in the players list to the player in the game This type of playerstats are used in games like Pet Simulator X, Bee Swarm Simulator and millions more How to create instances: - First of all, an instance is EVERYTHING that makes up a game, 3D objects, 2D objects, services and EVERYTHING contained in the explorer (even hidden services) - To create instances dynamically you use the class "Instance", to do it, you do it this way: local myPart = Instance.new("Part") myPart.Parent = workspace myPart.Anchored = true -- we can change all the properties that a part has! The first parameter of "Instance.new", is the name of the class (of the object to create) of the object that we want to create It is important to know that this function returns the instance that you have just created, so if you don't change the parent, only the memory will exist but not visually How to create stats in the players list: - You need to create a folder whose name MUST be "leaderstats" (so did roblox, don't ask). Then you will need to assign the parent to the player who joins the game - Then you must create intvalues, numbervalues and other things inside the folder For example: local folder = Instance.new("Folder") folder.Parent = player -- IMPORTANT folder.Name = "leaderstats" -- IMPORTANT local coins = Instance.new("IntValue") coins.Parent = folder coins.Name = "Coins".
Alright men, you have made it this far. May you be ready for the beast of the next episode. May god help you understand the final trial called ''tables''
Bro this I did a tutorial couple of months ago and i was so puzzles with the Leader boards stats. But now you showed me so much to leader board stats that this has boosted my motivation on developing games to Max. This Defiantly Deserved way more Likes and Views, this is peak Scripting Tutorials!!!
For those who are saying that their new values such as "money" or whatever your using is not SHOWING (except leaderstats) make sure your script runs server-side! Properties > Behaviour > Runcontext Hope this helps!!
Decided to incorporate the Kill Brick script into this assignment to mesh the learnings together. I created two functions. One function supply's the user coins if they touch a specific block, while the other makes the player lose coins and die if they touch another local coinPart = game.Workspace.TouchPart local debounce = false coinPart.Touched:Connect(function(otherPart)
if debounce == false then debounce = true print(otherPart) coins.Value = coins.Value + 10
task.wait(2) debounce = false end
end) local lossPart = game.Workspace.KillBrick lossPart.Touched:Connect(function(otherPart)
if debounce == false and coins.Value > 10 then debounce = true print(otherPart) coins.Value = coins.Value - 10
@@CrimsonMoonVr101 local killBrick = script.Parent local bool = false game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player
bro ngl its like my 8th hour watching those today and ur teaching so good that it feels so easy to make scripts now and before id have to google every script even after tutorials
i fogo- loops and tables but decided to watch a begginer scripting series complete and now i think thank god i watched again or else i wouldve beeen able to do nothing
I'm watching every single one of these tutorials, and, while i watch, im doing a WHOLE ESSAY about them, i have everything noted on my dms and i basically have some clever explanations of what happens here in my native language! these tutorials help alot you learn from thee bottom
tahnks soh much i just made a game with randomly falling asteroids with random sizes and velocities that kill you on touch and now that i watched this a timesurvived stat that increases every second and resets when you die, that is also a way i put badges in my game like if the timesurvived is already equal to 30 then u get the badge survive 30 seconds (devforum carried me)
Hey everyone, just wanted to say that an easier way to increment a variable is to do: variableName += value So for instance, local x = 0 x += 2 --increments x by 2 --Can also subtract with this x -= 2 --decrements x by 2 I hope this doesn't break anyones code
I found that out since according to many people, Lua script was similar to Python so I just did a little experimenting by typing things that would normally work in Python and += and -= worked in Lua too :D
You can use an if statement to check if player name = yourplayername then assign it to a value lets say string . value = "Developer" else string . value = "Player"
there might be and should be a better way to do this since if you change your name, this breaks. like using PlayerID or something which is unique and will never change.
Im actually proud of this one cant believe i did it by myself local db = false local function onTouch(otherPart) local player = game.Players:GetPlayerFromCharacter(otherPart.Parent) if player then local leaderstats = player:FindFirstChild("leaderstats") local coins = leaderstats:FindFirstChild("Coins") if coins and not db then db = true coins.Value = coins.Value + 1 script.Parent.CanTouch = false script.Parent.Transparency = .7 --I did this by myself!! LES GOOOOO task.wait(3) script.Parent.CanTouch = true script.Parent.Transparency = 0 db = false end end end script.Parent.Touched:Connect(onTouch)
oh i know how did this work first, if you touched a part you will add a coin from its leaderstats with debounce preventing the player to get too much money from just touching a part. second, it will make the part go transparent to opaque
seeing people in comments make so much better stuff with these tutorials while I am scratching my brain figuring out same stuff as them makes me feel shit honestly awesome vids tho
i dont know how to make the player only touch button this is what i got make the part fly local part = game.Workspace.Part local coins = 0 part.Touched:Connect(function(player) print("1+ coin!") print(coins) coins = coins + 1
@@stupidoBanana you can add here the FindFirstChildWhichIsA("Humanoid") command to prevent generating the coins when some other part is already touching it
Put this script inside of the part that you want to give coins on touch: local part = script.Parent local coins = 25 part.Touched:Connect(function(hit) local character = hit.Parent if character:FindFirstChild("Humanoid") then print(hit) local player = game.Players:GetPlayerFromCharacter(character) player.leaderstats.Coins.Value += coins part:Destroy() -- Only keep this if you want to destroy the part after collection. end end)
I encountered something to where my code was constantly doublespaced while only taking up one line of code while i was trying to create a ranking system based off of the coins you had. Other than that do you know why i stat using a Stringvalue doesn't work (the code is basically the same as the coins instance code but with a string value and the value being a string)
If You Made The Timer Properly, Then The Problem Is The fact That PlayerAdded Is an Event That only executes code at the beginning when the player enters so make a function or loop to check every frame is the player dies and is the players does die then make your time equal 0
tbh cht ik tis random but i was deving a game based of sekiro and has 26 hours of gameplay sadly today i quit game devolpemnt due to being a one man team
@@The_BassWood_Who_Cried_Pancake well the leaderstats folder only is created after the script ran so you might need to use wait for child or something?
local button = script.Parent button.Touched:Connect(function(otherpart) local human = otherpart.Parent:FindFirstChild("Humanoid")
if human then local newPart = Instance.new("Part") newPart.Parent = game.Workspace.Button newPart.Size = Vector3.new(3, 3, 3) newPart.Position = Vector3.new(0, 3, 2) newPart.BrickColor = BrickColor.new("Sea green") newPart.Shape = Enum.PartType.Ball newPart.Mass = 0.001 end end) also if you know how to set a limit on how many new parts are made I would appreciate it
Anyone know how to remove leaderstats from leaderboard and when i try to change it doesn't work and it follows every new game i make pls help im begging you brawl dev read this
ok so go to your leaderstats folder inside of your character and delete it, if you cant find this make a script inside of the workspace and type this. game.Players.PlayerAdded:Connect(function(player) local leaderstats = player.FindFirstChild("leaderstats") leaderstats:Destroy() end) This will delete any instance inside your player that is named "leaderstats" you will have to make this script in every game you make but this is only if you cant delete your leaderstats folder!
i tried making a code where when it reachs 60 seconds it goes to 1 minute but when i made the code there isint a second or minute at all in the leaderboard the code is like them same how you did with the coins for seconds and then i have the minute code but instead of "while true do" i have "if Seconds.Value == 60 then Seconds.Value = 0 Minutes.Value = 1 how i would fix this code
This code may help you, let me know if you encounter any issues. (Put this at the bottom of your code, after you create your instances.) while true do task.wait(1) Seconds.Value = Seconds.Value + 1 if Seconds.Value == 60 then Seconds.Value = 0 Minutes.Value += 1 task.wait(0.1)
maybe you just made it wrong the computer almost always right so you made a mistake (im too lazy to make a reply so i just copy the reply i sent to the person on top of u)
hello everyone! I tried to make game of collecting coins, basically combining all I learn from the tutorials above, but I can't figure out why the coin always come up at the same place, not randomly. Could anyone help me?
after a lot time thats best what i got game.Players.PlayerAdded:Connect(function(player) local LS = Instance.new("Folder") LS.Name="leaderstats" LS.Parent=player local Berry = Instance.new("IntValue") Berry.Name="Berry" Berry.Parent=LS Berry.Value=0 local Kills = Instance.new("IntValue") Kills.Name="Kills" Kills.Parent=LS Kills.Value=0
local RG=math.random(1, 100)
local function RGG() if RG 50 and RG 70 and RG 80 and RG 90 and RG 95 and RG
i made a time leaderstat lol (its bassically the same thing except the name is time instead of coins) game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player
Isn't it obvious? Not all games are the same so some want to have coins in the leaderboard, some want to have gems, some want to have a made-up currency or even something like time or speed
hey brawldev I really like your vids and I am looking forward to learn from you in real time rather than videos. I wish we both can create a game on day
thanks for the guides! for this learning objective i did: game.Players.PlayerAdded:Connect(function(player) task.wait(1) local leaderstats = player:FindFirstChildOfClass("Folder") local coins = leaderstats:FindFirstChildOfClass("IntValue") local partIsTouched = false
local tp = game.Workspace.touchPart local chat = game:GetService("TextChatService") tp.Touched:Connect(function(otherPart) if partIsTouched == false then partIsTouched = true chat:DisplayBubble(tp, "ouuchhh dont touch me that hurts") tp.Material = "Neon" tp.Color = Color3.new(1,0,0) task.wait(1) tp.Color = Color3.new(1,1,0) task.wait(1) tp.Color = Color3.new(0,1,0) task.wait(1) tp.Color = Color3.new(0,0,1) task.wait(1) tp.Material = "Plastic" coins.Value += 20 tp.BrickColor = BrickColor.new("Medium stone grey") task.wait(3) chat:DisplayBubble(tp, "waaiiitttt did you just,,, STEAL FROM ME... come BACK you DIRTY SCOUNDREL.") partIsTouched = false end end) end) the chat:DisplayBubble's broke after a while and i couldnt figure out why so sadly that doesnt really work :(
you meant chat:DisplayBubble(tp, "ouuchhh dont touch me that hurts") by: Print("player, ",ouuchhh dont touch me that hurts") if that helps tell me i want to know
king u make this stuff interesting
tuff
@Marco-i8h2d SAMEEEEEEEE
@@muichiro5666 SAME!
@SkillZ_49 SAME!!!
@@Kakab3ba SAME!
12:07 i love how you say "other developers" instead of just "other people"
lol if you make it this far into the tutorial guide ig u deserve it ;)
Holy I've watched all the tutorials but the people in the comments are just so talented makes feel like I learned nothing
for real my code doesnt even work
same
@@XqlWasTaken just use some debug methods like print.
whenever u feel stupid, you are learning its how it is
@@ways8027 exactly
Today's Summary:
playerstats (or leaderstats), is a special folder created inside the player instance which will contain IntValues or other values which will be displayed as a table in the players list to the player in the game
This type of playerstats are used in games like Pet Simulator X, Bee Swarm Simulator and millions more
How to create instances:
- First of all, an instance is EVERYTHING that makes up a game, 3D objects, 2D objects, services and EVERYTHING contained in the explorer (even hidden services)
- To create instances dynamically you use the class "Instance", to do it, you do it this way:
local myPart = Instance.new("Part")
myPart.Parent = workspace
myPart.Anchored = true
-- we can change all the properties that a part has!
The first parameter of "Instance.new", is the name of the class (of the object to create) of the object that we want to create
It is important to know that this function returns the instance that you have just created, so if you don't change the parent, only the memory will exist but not visually
How to create stats in the players list:
- You need to create a folder whose name MUST be "leaderstats" (so did roblox, don't ask). Then you will need to assign the parent to the player who joins the game
- Then you must create intvalues, numbervalues and other things inside the folder
For example:
local folder = Instance.new("Folder")
folder.Parent = player -- IMPORTANT
folder.Name = "leaderstats" -- IMPORTANT
local coins = Instance.new("IntValue")
coins.Parent = folder
coins.Name = "Coins".
dang
Im just copy n pasting what u say on a Google Doc cuz im too lazy to write...
@@TropialGamingYT basic what im doing
you can put the script in ServerScriptService to prevent exploiters changing the value property
Thisis very helpful :)
"hello world" (print)
nuh uh 😭
💀🙏
W code
@@Who1156 😂😂 print("im LEARNING")
What code is this🤔🤔🤔🤔
Alright men, you have made it this far. May you be ready for the beast of the next episode. May god help you understand the final trial called ''tables''
gulp
you actually scared me..
I understood it so easily, either you are bluffing or I'm built different
Bro this I did a tutorial couple of months ago and i was so puzzles with the Leader boards stats. But now you showed me so much to leader board stats that this has boosted my motivation on developing games to Max. This Defiantly Deserved way more Likes and Views, this is peak Scripting Tutorials!!!
same XD
For those who are saying that their new values such as "money" or whatever your using is not SHOWING (except leaderstats) make sure your script runs server-side!
Properties > Behaviour > Runcontext
Hope this helps!!
New subscriber from spain, I hope this tutorials help me make my dream games
good luck bro!👍
Decided to incorporate the Kill Brick script into this assignment to mesh the learnings together. I created two functions. One function supply's the user coins if they touch a specific block, while the other makes the player lose coins and die if they touch another
local coinPart = game.Workspace.TouchPart
local debounce = false
coinPart.Touched:Connect(function(otherPart)
if debounce == false then
debounce = true
print(otherPart)
coins.Value = coins.Value + 10
task.wait(2)
debounce = false
end
end)
local lossPart = game.Workspace.KillBrick
lossPart.Touched:Connect(function(otherPart)
if debounce == false and coins.Value > 10 then
debounce = true
print(otherPart)
coins.Value = coins.Value - 10
task.wait(2)
debounce = false
end
end)
The scripts are in defferent parts?
@@Stream7812 yes, it seems that the first script gives you a currency, while the other removes it if you have 10 bucks or more.
OMG! this crazy! i just created a block , that when touched, changes its color and gives you money! cudnt have done this without you! thanks a lot man
Pls tell me how
@@CrimsonMoonVr101 local killBrick = script.Parent
local bool = false
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Money = Instance.new("IntValue")
Money.Parent = leaderstats
Money.Name = "Money"
Money.Value = 0
task.wait(1)
killBrick.Touched:Connect(function(otherPart)
if bool == false then
bool = true
Money.Value += 1
killBrick.BrickColor = BrickColor.new("Really red")
task.wait(0.5)
killBrick.BrickColor = BrickColor.new("Medium stone grey")
task.wait(0.5)
if Money.Value % 10 == 1 and Money.Value ~= 1 then
killBrick.BrickColor = BrickColor.new("Pink")
task.wait(5)
end
bool = false
end
end)
end)
@@CrimsonMoonVr101 Learn
dude, when i readed your comment i did the same and it worked!!! it's crazy bc i didnt know i could do this, im so happy too :D!
if you watch and do at the same time you can learn that pretty easy. And if you cant do that, watch the series again.
bro ngl its like my 8th hour watching those today and ur teaching so good that it feels so easy to make scripts now and before id have to google every script even after tutorials
Frickin love u man. Better than most of my actual teachers
so true XD
fr my teacher dont know what print is XD
@@muichiro5666 how does a IT teacher not know what a print is?
your tutorial is so interesting i watched it for like 2 days now and i am already here
i fogo- loops and tables but decided to watch a begginer scripting series complete and now i think thank god i watched again or else i wouldve beeen able to do nothing
I'm watching every single one of these tutorials, and, while i watch, im doing a WHOLE ESSAY about them, i have everything noted on my dms and i basically have some clever explanations of what happens here in my native language! these tutorials help alot you learn from thee bottom
dude may i please have the text you have so i can read over discord 6oys if you can send it over
i thought you quit, i didnt know you had a new channel lol
Yesssir! Glad you found me again! 😊
what is his other channel
@@z1ngetsuu sigmaplayz_YT
New subscriber! From Brazil
Keep up the work dude. This has got to be the best playlist for scripting. Love the work!!
keep it up! love this searies just found it im gonna start reaching for my dreams again!
I always love your videos man very educational
Also here’s a very small reminder:
Instead of saying
coins = coins + 1
you can simply type
coins += 1
Why does this work?
@@Pokeshek1+= I think it can be used as a shortcut for +1
@@qqqqty9404 coins+=1 is the same as coins = coins+1. So it repeats the coins
does it affect the speed of the code?
Thank you so much!! really helped
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player
local seconds = Instance.new('IntValue')
seconds.Name = 'Seconds'
seconds.Value = 0
seconds.Parent = leaderstats
local minutes = Instance.new('IntValue')
minutes.Name = 'Minutes'
minutes.Value = 0
minutes.Parent = leaderstats
while player.Parent do
task.wait(1)
seconds.Value = seconds.Value + 1
if seconds.Value >= 60 then
seconds.Value = 0
minutes.Value = minutes.Value + 1
end
end
end)
feel like that wouldn't work
tahnks soh much i just made a game with randomly falling asteroids with random sizes and velocities that kill you on touch and now that i watched this a timesurvived stat that increases every second and resets when you die, that is also a way i put badges in my game like if the timesurvived is already equal to 30 then u get the badge survive 30 seconds (devforum carried me)
i feel so talented after going over this once i understand it all
Thanks for these simple tutorials, really got me into scripting!
New subscriber from France !
New Subscriber! You Making Good Videos
Hey everyone, just wanted to say that an easier way to increment a variable is to do: variableName += value
So for instance,
local x = 0
x += 2 --increments x by 2
--Can also subtract with this
x -= 2 --decrements x by 2
I hope this doesn't break anyones code
I found that out since according to many people, Lua script was similar to Python so I just did a little experimenting by typing things that would normally work in Python and += and -= worked in Lua too :D
@@theflightsimaviation9663 Yep same way I found out too!
@diamondsminer1239 Cool!
why is this TH-camr so underatedd :(((
how do you make so the stats save after you leave and rejoin?
i think its related to datastore
this series has helped out so much! i really appreciate the time and effort you’ve put into these videos, new subscriber!
i learn something new today ..
Thank you i have learned so much from you. Now i can try and make my own game
Yo im almost there wish me luck
You can also write coins.Value += 1 instead of coins.Value = coins.Value + 1
Yes! new video
You can use an if statement to check if player name = yourplayername then assign it to a value lets say string . value = "Developer" else string . value = "Player"
there might be and should be a better way to do this since if you change your name, this breaks. like using PlayerID or something which is unique and will never change.
with the name part with the coins it doesn't work. It says its not defined
Do you have to set a parent for the instance or can you keep the instance parent the default parent?
What if he was called FreakDev and freaked all over the place
Im actually proud of this one cant believe i did it by myself
local db = false
local function onTouch(otherPart)
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
local leaderstats = player:FindFirstChild("leaderstats")
local coins = leaderstats:FindFirstChild("Coins")
if coins and not db then
db = true
coins.Value = coins.Value + 1
script.Parent.CanTouch = false
script.Parent.Transparency = .7 --I did this by myself!! LES GOOOOO
task.wait(3)
script.Parent.CanTouch = true
script.Parent.Transparency = 0
db = false
end
end
end
script.Parent.Touched:Connect(onTouch)
what does this code do
@@tochukwuagwuh4989 nothing ask chatgpt
oh i know how did this work
first, if you touched a part you will add a coin from its leaderstats with debounce preventing the player to get too much money from just touching a part.
second, it will make the part go transparent to opaque
@tochukwuagwuh4989it add money to the stats of the player like adding coins if you young the part
It doesnt show up on me "coins" i seee folder and its child leaderstat but when i run its just my name
I saw full video and i now know how to type's😮
seeing people in comments make so much better stuff with these tutorials while I am scratching my brain figuring out same stuff as them makes me feel shit honestly
awesome vids tho
On the coins part it somehow doesn’t work, ive typed it in correctly 2 times and it still doesnt appear next to my user
I hope this is alright!
local pet = math.random(1,4)
if pet == 1 then
print("you got a cat!")
elseif pet == 2 then
print("you got a dog!")
elseif pet == 3 then
print("you got a hamster!")
elseif pet == 4 then
print("you got a mouse!")
end
Is it necessary to put leaderstats as variable?
Ah finally, About to finish learning scripting then he says "advanced tutorial" AWH HELL NAW (i will watch it
Can u make a tutorial on if the player touches a block it will give you a certain amount of coins, such as 25-50
i dont know how to make the player only touch button this is what i got
make the part fly
local part = game.Workspace.Part
local coins = 0
part.Touched:Connect(function(player)
print("1+ coin!")
print(coins)
coins = coins + 1
end)
@@stupidoBanana you can add here the FindFirstChildWhichIsA("Humanoid") command to prevent generating the coins when some other part is already touching it
@@stupidoBanana thats just you forgot to anchored it bro 😭
you didnt make it fly
Put this script inside of the part that you want to give coins on touch:
local part = script.Parent
local coins = 25
part.Touched:Connect(function(hit)
local character = hit.Parent
if character:FindFirstChild("Humanoid") then
print(hit)
local player = game.Players:GetPlayerFromCharacter(character)
player.leaderstats.Coins.Value += coins
part:Destroy() -- Only keep this if you want to destroy the part after collection.
end
end)
@@legendzaryjwhy part instead of SSS?
I am so confused with math.random as to how to make map randomization.
i tried a bunch now its making the whole value and its in the folder its just not next to the player like shown
What if i want the playerstats to be only visible when a player only holds the Tab button, how can be made like that and also what about GUI?
You Gonna Have to Watch His GUI tutorial Series
I encountered something to where my code was constantly doublespaced while only taking up one line of code while i was trying to create a ranking system based off of the coins you had. Other than that do you know why i stat using a Stringvalue doesn't work (the code is basically the same as the coins instance code but with a string value and the value being a string)
Roblox studio just automatically filled my code in for me
Thanks man
i dont have the player character in the workspace, is this outdated or is there a problem on my end?
dude im trying to learn it and even copied it one to one it isnt working for me for some reason im gonna try some more times
Why can’t I make a stat that says how long you’ve been alive like in other games I’ve tried so many times and it never worked?
If You Made The Timer Properly, Then The Problem Is The fact That PlayerAdded Is an Event That only executes code at the beginning when the player enters so make a function or loop to check every frame is the player dies and is the players does die then make your time equal 0
tbh cht ik tis random but i was deving a game based of sekiro and has 26 hours of gameplay sadly today i quit game devolpemnt due to being a one man team
i made a time Leader stat :D
I failed my asssigment, unfortunately I couldnt come with anything because I didnt know how to come up with it-
Probably not the best idea to put a unwrapped While Loop inside the Player Added event 😅
for some reason the first code shown does not work for me
😭Is it possible to read that stat in other scripts?
I've been trying but it keeps saying that it can't find the leaderstats folder
@@The_BassWood_Who_Cried_Pancake
well the leaderstats folder only is created after the script ran so you might need to use wait for child or something?
@@fujiwaranonekobiodrando1257 I used both wait for child and find first child
it didnt work with either one
Actually, in the Final Episode, he does make something like that so I would reccomend looking at that
@@The_BassWood_Who_Cried_Pancake AWESOME
how do you make it so that it stops adding and resets on death
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local playtime = Instance.new("IntValue")
local current_time = tick()
playtime.Name = "Play Time"
playtime.Parent = leaderstats
while true do
playtime.Value = tick() - current_time
wait(1)
end
end)
local button = script.Parent
button.Touched:Connect(function(otherpart)
local human = otherpart.Parent:FindFirstChild("Humanoid")
if human then
local newPart = Instance.new("Part")
newPart.Parent = game.Workspace.Button
newPart.Size = Vector3.new(3, 3, 3)
newPart.Position = Vector3.new(0, 3, 2)
newPart.BrickColor = BrickColor.new("Sea green")
newPart.Shape = Enum.PartType.Ball
newPart.Mass = 0.001
end
end)
also if you know how to set a limit on how many new parts are made I would appreciate it
u can add a variable (0) that increments everytime u touch it, the limit would probably be (if i < 10 then) so it would would limit to 10
Confused unga bunga
Anyone know how to remove leaderstats from leaderboard and when i try to change it doesn't work and it follows every new game i make pls help im begging you brawl dev read this
ok so go to your leaderstats folder inside of your character and delete it, if you cant find this make a script inside of the workspace and type this.
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = player.FindFirstChild("leaderstats")
leaderstats:Destroy()
end)
This will delete any instance inside your player that is named "leaderstats" you will have to make this script in every game you make but this is only if you cant delete your leaderstats folder!
i dont know why but the entire part of coins was not working for me and i copied the code exatly the same
Yeah same
does the leaderstats have to be an IntValue or can it be a string value or something?
somebody please answer
Yes, it has to be an IntValue because a new number instance is being created
ye a int value its for number and string is for word
(if im not dum)
@@topellis Yeah that's right!
nothing will happen and i new part wont show in the workspace
2 views in 1 minute is CRAZY
no scuffed simulator?
hi mr scuffed owner
did roblox update the scripting cuz this isnt working for me.
EDIT: it works now
i tried making a code where when it reachs 60 seconds it goes to 1 minute but when i made the code there isint a second or minute at all in the leaderboard the code is like them same how you did with the coins for seconds and then i have the minute code but instead of "while true do" i have "if Seconds.Value == 60 then Seconds.Value = 0 Minutes.Value = 1 how i would fix this code
This code may help you, let me know if you encounter any issues.
(Put this at the bottom of your code, after you create your instances.)
while true do
task.wait(1)
Seconds.Value = Seconds.Value + 1
if Seconds.Value == 60 then
Seconds.Value = 0
Minutes.Value += 1
task.wait(0.1)
end
end
end)
just use chatgpt if you dont inow why it wont eork
@@t8bxyep
Why is it not working for me
😭
maybe you just made it wrong
the computer almost always right so you made a mistake
(im too lazy to make a reply so i just copy the reply i sent to the person on top of u)
w h y d o i n o t s e m y s c r i p t
hello everyone! I tried to make game of collecting coins, basically combining all I learn from the tutorials above, but I can't figure out why the coin always come up at the same place, not randomly. Could anyone help me?
Idk I'm also new but there are cordinate in roblox studio so you could use the math.random script to make it appear at random ppaces
@@jiggy6814might be a xyz coordinate.
after a lot time thats best what i got
game.Players.PlayerAdded:Connect(function(player)
local LS = Instance.new("Folder")
LS.Name="leaderstats"
LS.Parent=player
local Berry = Instance.new("IntValue")
Berry.Name="Berry"
Berry.Parent=LS
Berry.Value=0
local Kills = Instance.new("IntValue")
Kills.Name="Kills"
Kills.Parent=LS
Kills.Value=0
local RG=math.random(1, 100)
local function RGG()
if RG 50 and RG 70 and RG 80 and RG 90 and RG 95 and RG
bro its not even working for me i have the same exact stuff
nvm i got it fixed
how to fix man?
@@guyonyt4396 whats ur script?
can someone help me i wrote the same code as brawldev but it did not worked
i made a time leaderstat lol (its bassically the same thing except the name is time instead of coins)
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Time"
coins.Value = 0
coins.Parent = leaderstats
while true do
task.wait(1)
coins.Value = coins.Value + 1
end
end)
Why can’t this just be in the game?
Isn't it obvious? Not all games are the same so some want to have coins in the leaderboard, some want to have gems, some want to have a made-up currency or even something like time or speed
the script isnt working for me
maybe you just made it wrong
the computer almost always right so you made a mistake
@@reaklaz nah
@@reaklaz i know now
@@reaklaz its just i didnt fix my script
@@CriticalWow ok
print("hello world")
hey brawldev I really like your vids and I am looking forward to learn from you in real time rather than videos. I wish we both can create a game on day
Code not working
'
I CANT
0:00 first
bruh i think that it was smth else
W
Somone teach me i can pay with robux
First
32 views in 15 mins bro fell off
He does usefull tutorials
Yt comment section is done at this point
Bro he has only 11k subs like bro?
Bro this fell off meme is so bad
14 likes in 2 months bro fell off
thanks for the guides! for this learning objective i did:
game.Players.PlayerAdded:Connect(function(player)
task.wait(1)
local leaderstats = player:FindFirstChildOfClass("Folder")
local coins = leaderstats:FindFirstChildOfClass("IntValue")
local partIsTouched = false
local tp = game.Workspace.touchPart
local chat = game:GetService("TextChatService")
tp.Touched:Connect(function(otherPart)
if partIsTouched == false then
partIsTouched = true
chat:DisplayBubble(tp, "ouuchhh dont touch me that hurts")
tp.Material = "Neon"
tp.Color = Color3.new(1,0,0)
task.wait(1)
tp.Color = Color3.new(1,1,0)
task.wait(1)
tp.Color = Color3.new(0,1,0)
task.wait(1)
tp.Color = Color3.new(0,0,1)
task.wait(1)
tp.Material = "Plastic"
coins.Value += 20
tp.BrickColor = BrickColor.new("Medium stone grey")
task.wait(3)
chat:DisplayBubble(tp, "waaiiitttt did you just,,, STEAL FROM ME... come BACK you DIRTY SCOUNDREL.")
partIsTouched = false
end
end)
end)
the chat:DisplayBubble's broke after a while and i couldnt figure out why so sadly that doesnt really work :(
you meant chat:DisplayBubble(tp, "ouuchhh dont touch me that hurts") by:
Print("player, ",ouuchhh dont touch me that hurts")
if that helps tell me i want to know
@@reaklaz print puts it in the output
i made a gambling machine with the math.random and the currency
brawldev, did i make you proud?
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local timeplayed = Instance.new("IntValue")
timeplayed.Name = "Time Played"
timeplayed.Value = 0
timeplayed.Parent = leaderstats
while true do
wait(1)
timeplayed.Value = timeplayed.Value + 1
end
end)
My Script, +1 speed every second
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Speed = Instance.new("IntValue")
Speed.Name = "Speed"
Speed.Value = 0
Speed.Parent = leaderstats
while true do
wait(1)
Speed.Value = Speed.Value + 1
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 0
while true do
wait(1)
humanoid.WalkSpeed = Speed.Value
end
end)
end
end)
local block = game.Workspace.Block
local playerHasTouched = false
block.BrickColor = BrickColor.new("Lime green")
block.Material = "Neon"
game.Players.PlayerAdded:Connect(function(player)
local leaderStats = Instance.new("Folder")
leaderStats.Name = "leaderstats"
leaderStats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = leaderStats
block.Touched:Connect(function(otherPart)
if playerHasTouched == false then
playerHasTouched = true
block.BrickColor = BrickColor.new("Really red")
coins.Value = coins.Value + 1
print(player, "has gained a coin!")
task.wait(1)
playerHasTouched = false
block.BrickColor = BrickColor.new("Lime green")
end
end)
end)