#is there any way i can make a badge be awarded after a part changes color?
1 messages · Page 1 of 1 (latest)
This is what it looks like also im kinda new at scripting so this might lowkey not be that great of a script but it gets the job done
can't you just give the badge right after the part changes color in the same script?
yo
i should be doing my math homework lmao
I got a social final tmr 😭
idk how to do that brochacho
i tried a few scripts and stuff on youtube but NONE worked
all i could manage is a welcome badge
script or localscript
so how would i make like the badge go off the specific part's color?
jesse you wanna do it?
wallahi im finished
** You are now Level 1! **
Alr so
i been tryna get this thing to work for like 4 hours lmao
the issue might be coming from the fact that the Touched event triggers multiple times, so the didSomething function could be fired more than once
oh so you need to add a debounce
damn
you know how to do those?
well i kinda designed the map so the only part that can touch the goal
is the ball
and it freezes in the air after and doesent touch it again
not really thats why i came up with this scuffed ass ''ball stays in the air after'' thing
ah ok
Lol
** You are now Level 6! **
so the principle of a debounce is that you immediately lock an event as soon as it's triggered
hold on let me clip how it works rq
like this
oh
so it cant happen again
yea
local win = false
finish.Touched:Connect(function()
if win == false then
win = true
--the rest of the script
end
end)
alr
the immediate "win = true" stops any more repeats from happening
https://streamable.com/fy8npm this is kinda the whole idea
cuz i didnt know how to make it so it only goes off if the BALL touches it
so i made it so if a PLAYER touches it they get kicked
oh peak
sweet
lol
scuffed ahh game
legit everytime something i wanst able to do came up
i pulled random bullshit out my ass
''oh ig ill make it stuck in the air''
😭
i don't blame you for trying that
oh yeah, did you solve your problem, remember to change the tag
oof
hold on let me figure that out
waht do i replace finish with
yeah
😭
💀
i wanted to troll my friend with the classic sisyphus but then i forgot i just finished a beginner scripting tutorial
LMAO
i didnt know badges were finna be a hassle
my friend figured out how to hide other names from the server list so we pretended to be ai for half an hour
it was hilarious
there superrr easy if you integrate it properly 😭
the thing is
got our friend to join and "test" the game and the whole time he thought we were bots
i dont know the proper command aside from ''awardBadge()''
since this affects all players you probably just need to assing it individually
listen vro idk how to script but i DID come up with many scuffed workarounds
which is good
btw it gives me an error saying ''Unknown global'' finish and i feel like i just did smthing rly dumb and idk what it is
oh
local Players = game.Players:GetPlayers()
for i = 1, #Players do
Players[i]:AwardBadge("IDorsomethingidklol")
end
** You are now Level 3! **
but how do i make it so this goes off the part being green
** You are now Level 2! **
2 variables refernecing the same
just put it in the same spot where you wrote that
local didntwin = game.Workspace.WIN
local Winner = game.Workspace.WIN
both are referncing game.Workspace.WIN
oh huh.
💀
wait im lowkey sped i dint realize
and adjust the script
im sped too dw 😭
helping with code is fun its kinda a fever dream when i only half know what im talking about lmao
thx! :D
uh ignore that 🌚
i think you called it WIN
idk
😭
bro litterly jut did 😭
let me remove didnotwin
add the local to it
alr alr look your top should look like this
local WIN = game.Workspace.WIN
local FINISH = game.Workspace.FINISH (but idk if its just like that or if its parented)
local win = false
then you wont need finihs.touched
and that part would be local function doSomething(otherPart)
u wanna delete
well damn
wait where is that im blind
so do i replace winninbg with WIN or FINISH
WHAT DID I JUST CREATE HOLY
i just made a lab experiment
you might even want to just start from the beginning to be totally honest
well damn!
yeah i can help you
so how wouldi make it so when my boulder called ROCK hits the part called ''WIN'' it turns green and gives a badge
should i rename the part named win cuz its lowkey confusing
hmm it is usually a good idea to give stuff unique names, you have a lot of events and definitions with the word "win"
i feel like i overcomplicated the whole thing
Aight ima just help you from square one
"winPart" isn't a bad idea
well lets name win ''Gizzlegoozer
oh
cuz im looking at that and m not seeing BadgeService
winPart why not
ay listen man
💀
you had badge award attempt, but it was inside the didsomething function, and it only applied to a specific situation BUT if we use (for i = 1, #Players do) this ensures that every player gets the badge when the Rock part condition is met
okay
also otherPart.Parent:FindFirstChildWhichIsA("Part") which could have been too general and prone to errors
so how do i make the rock condittion not scuffed as fuck
so i think
part of the reason i messed up is cuz
it was originally maent to be a 1 player game
till i realized you needed 2 people to achieve it
this my first game if you couldn't tell 😼
** You are now Level 3! **
local didntwin = game.Workspace.WIN
local winning = game.Workspace.WIN
local WIN = game.Workspace.WIN
local FINISH = game.Workspace.FINISH -- (but idk if its just like that or if its parented)
local win = false
finish.Touched:Connect(function()
if win == false then
local function doSomething(otherPart)
if otherPart.Parent:FindFirstChildWhichIsA("Humanoid") then
game.Workspace.WIN.Color = Color3.fromRGB(255, 0, 0)
didntwin.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player:kick("YOU TRIED TO DECEIVE ME")
end)
end
end
local function didsomething(otherPart)
if otherPart.Parent:FindFirstChildWhichIsA("Part") then
game.Workspace.WIN.Color = Color3.fromRGB(0, 255, 0)
game.Workspace.Rock.Anchored = true
game.Workspace.Rock.Color = Color3.fromRGB(255, 255, 150)
local Players = game.Players:GetPlayers()
for i = 1, #Players do
Players[i]:AwardBadge("11887765621600395")
end
end
end
winning.Touched:Connect(doSomething)
winning.Touched:Connect(didsomething)
end
end)
this is ur script alr
alright
i myself went abt and made a version that SHOULD work, but i wont send it ima walk you through it so you learn
alright
your gonan wanna have your top of the script looking like
local didntwin = game.Workspace.WIN
local winning = game.Workspace.WIN
local WIN = game.Workspace.WIN
local FINISH = game.Workspace.FINISH
local win = false
alright
and make sure all of your parts and stuff are named to those
or else youll get errors
where was this script to begin with 😭
well ORIGINALLY
then yes
niperwolf
.
naw i forogt she exsited 😭
alr now this is really imporatnt for badges
local BadgeService = game:GetService("BadgeService")
ye
you understand the script you have so far right? any questions
yeah i do
shoot
i just forgot to re-add
uh BadgeService earlier
i had it but then
after tampering and messing it up
😭
it got lost in the sauce
naw thats just wild 😭
ay ill take credit where i can take it
yeah i got it
now ur badge part you have\
so far just variables for simplifaciton
i want you to add your badge id without my help how will you?
Good job
thats what i put for my variable
local badgeId = "11887765621600395"
oh i gotta put "
close enough
holy moly im literally a pro scripter!
Sigma!
call me the new phoeyu i stg
now u got ur top part done
ye
yk how too right
then make a finish part
do i just put it on top of the old plate
look like
this plate
thats the ''Win'' part
the thing thats red?
yeah
yuh
so i add a transparent over it?
yeah but make sure players still can touch the win part
keep taht on
here ill add finish like this
** You are now Level 4! **
Aigh
alr look your gonan wanna call FINISH first to the ts
then touched and connect to funciton
just do this part first
alright
send it here when yo done
wdym space
space bar
or enter 😭
alr
then inide u wanna add when win is equal to false then
doSomething will look for the humanioid
alright
wait
do something..???
its not there anymore gng
do something was in the other one
trust the process
alright
wait so
dosomething will look for the humanoid so like
findfirstchild
should i put this BELOW when
dosmt should be below
** You are now Level 7! **
alr
i just said it in english terms for you 😭
yes
local function dosomething(otherPart)
if otherPart.Parent:FindFirstChildWhichIsA("Humanoid") then
game.Workspace.WIN.Color = Color3.fromRGB(255, 0, 0)
didnotwin.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player:Kick("YOU TRIED TO DECEIVE ME")
end)
end
end
and i just put it at where i put ''when'' like an idiot
below it
should i do ''if win = false then'' and put it below that
if win == false then
and where do i put do something findfirstchild
also repalce didnotwin with what u have now for that
💀
well wtv
2 extra ends 😭
so i replace dosomething with ''didntwin'' ?
wait nvm ur chill
didntwin indeed so
help why is it red now
now no red right
alr go to the 3rd end
aight
click enter
alright
now ur gonna do the last part
cuz im just better
im ngl i have no idea what im doing twin
i prob should've finished the advanced scripting tutorials
now make a function named didsomething
alright
well maybe but this is basic
ye
so what will didsomething do
tahts the rock right
so i gotta make it so if the rock , hits ''WIN'' then it goes green
wait
it should hit finish
ALL I SAID WAS MAKE THE FUNCTION 😭
my bad gng
dw twin
close close
local function didsomething(otherPart)
u wouldnt put what were using inside ()
😭
im a genius
damn
its the same format as if win -- false then
so like
just some tweaks
idk twin 😭 🙏
gulp
yes wheres the rock at
bro never gonna wanna help anyone again after me
🥀
😭
nowhere bro dw
win?
AFDJPASDJAS
.
otherpart??
** You are now Level 5! **
YESS
holy shit first try man
now
alright so if otherpart erm
its gonna ___ to smt smt.Rock
remmeber its almost the same thing we did for the win
💔
we havent even gotten to the for loop yet 😭
were gonna get the rock
from workspace
i just imagine bro looking at my msgs like this
yes bro 😭 🙏
ay
Alr look this part is like
we gonna make it work man!!!
toddler level
so ill just give it
game.Workspace.WIN.Color = Color3.fromRGB(0, 255, 0)
game.Workspace.Rock.Anchored = true
game.Workspace.Rock.Color = Color3.fromRGB(255, 255, 150)
if i fail this ima kms
bro u better put this in the right spot
Nice
pure fear
yeah i aint even gonna lie too this ones hard to you
i lowkey stole it off a youtube video
💀
just LOWKEY
yeah i could tell 😭 🙏
here twin
local Players = game.Players:GetPlayers()
for i = 1, #Players do
BadgeService:AwardBadge(Players[i].UserId, badgeId)
end
wait i gotta
this is the for loop to award the players the badge
capitalize the D
.
💔
no...?
nah
😭
but your right in anycase tho if i didnet say it before
now u should have 3 ends
plus 2 at the bottom
under the 3rd end
ye
script when the WIN part is touched, run the didsomething function and pass in the part that touched it
oh thats easy
yea really easy
watch mefuck it up!
😭 🙏
😼
im best scripter man
no keep that
alr
alr
so the same thing but
with the dosomething
function
right?
YEA
YEAH!!!
THATS IT
momment of truth is to test
oh jessu
check output if it fials
.
same with the rock
was that error form the script
.
local didntwin = game.Workspace.WIN
local winning = game.Workspace.WIN
local WIN = game.Workspace.WIN
local FINISH = game.Workspace.FINISH
local win = false
local BadgeService = game:GetService("BadgeService")
local badgeId = "11887765621600395"
FINISH.Touched:Connect(function()
if win == false then
local function doSomething(otherPart)
if otherPart.Parent:FindFirstChildWhichIsA("Humanoid") then
game.Workspace.WIN.Color = Color3.fromRGB(255, 0, 0)
didntwin.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player:kick("YOU TRIED TO DECEIVE ME")
end)
end
end
local function didsomething(otherPart)
if otherPart == game.Workspace.Rock then
game.Workspace.WIN.Color = Color3.fromRGB(0, 255, 0)
game.Workspace.Rock.Anchored = true
game.Workspace.Rock.Color = Color3.fromRGB(255, 255, 150)
local Players = game.Players:GetPlayers()
for i = 1, #Players do
BadgeService:AwardBadge(Players[i].UserId, badgeId)
end
end
end
winning.Touched:Connect(doSomething)
winning.Touched:Connect(didsomething)
end
end)
yeah
ah
its the same exact thing eaither way u prob missed a end or smt
hmm
i own it
oh
that might be why
but wait
couldnt players just
jump onto the finish part
and then cheese the whole thing?
its suppose to only active when Rock actives win
why'd it break
if not you can easily implment it
GRAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
anything in op
its straight up in themiddle
if they manage to miss it atp
and the balls physics will 100% always
kinda deserve not to get it
on gng
wow thanks man
missing it would be harder 😭
i totally carried
Ofc bro
and i did everything first try!
Oh yeah bro the best learner
yeah i think next time ima actually finish learning
please do 🙏 😭
NOW I CAN RECREAT THIS MEME
ALL THAT FOR THAT
yes
i wanat my life back 
alright thanks brodie!!!
Ofcc gng make sure u add the sovled tag
thanks man have a good day
thanks for ur patience bro i would NOT
have stuck up with my own bs
Dw bro im glad to help take care and have fun scripting!
To manage your Leveling settings please visit your server dashboard via the button below
Here you go! 
BadgeService
You could also do it for the Players itself using for index, value in table loop
Dont spoonfeed
