another workaround for finding the player is simply doing this: local player = game.Players:FindFirstChild(tostring(tool.Parent)) When a player is holding the tool, the tool's parent is the player in Workspace, so it takes that, turns it into a string, and finds it in game.Players. great tutorial BTW
dude your deadass the best tutorial maker ive ever watched, i went through like half your series and as of now im just applying what ive learned to my games and i cant express enough how much my scripting has changed because fo you, not one other tutorial has worked please keep making these
These tutorials are awesome so far! I've wanted to get into scripting for a while now but never had the time to start. And now I'm on school holidays so I have time! I also did the challenge. I was a bit stuck and got a little help from your script. But yeah here it is! local tool = script.Parent local handle = tool.Handle local IsHolding = false local Sound1 = script.Equip local Sound2 = script.Unequip tool.Equipped:Connect(function() print("Tool has been equipped") Sound1:Play() end) tool.Unequipped:Connect(function() print("Tool has been unequipped") IsHolding = false tool:ScaleTo(1) Sound2:Play() end) tool.Activated:Connect(function() print("Tool has been activated") IsHolding = true tool:ScaleTo(1.8)
while IsHolding do task.wait(0.1) local r = math.random(0, 255) local g = math.random(0, 255) local b = math.random(0, 255) handle.Color = Color3.new(r, g, b) game.Players:FindFirstChild("BelugaLOLXDYT").leaderstats.Clicks.Value += 1 end end) tool.Deactivated:Connect(function() print("Tool has been deactivated") IsHolding = false tool:ScaleTo(1) while IsHolding == false do task.wait(0.1) handle.BrickColor = BrickColor.new("Medium stone grey") end end)
Only 3 videos into this playlist, watching these even with out following along, it's quite easier to understand them some others. I only know badics and cannot really do my own scripts other then simple part propertie changes and a touched. Even though ive watched and followed along a few different series over the last few years. I don't do enough. These videos are explained so well, thank you for going more in depth in a sense.
I love your videos! You somehow can make me understand Roblox scripting! I say this because I have never programmed in my life (like in any prog. language). Thanks again for these tutorials!
Question, in an RPG, let's say for example that you will have tens of different weapons. which of these is better/most optimal. Keep in mind that this RPG game would also have a trading system, so these weapons/items would be tradeable between players 1) create each weapon as a "Part" with their own textures, etc 2) create each weapon as a "Handle", and these handles would have their own texture, etc.
This is the best tutorials. I was able to make all 7 challenges in the other video + the bonus one and I also made that challenge about tools. I am so happy! TYSM.
very informative video and i love the challenges or tasks you give at the end really helps to fully engage and get hands on with what ive been taught this challenge was especially fun to do looking forward to your other videos!
Quick workaround, it should work when another player picks the tool up since it re-defines the variable on the Equipped event. tool.Equipped:Connect(function() plrName = script.Parent.Parent end) tool.Activated:Connect(function() game.Players:WaitForChild(plrName.Name).leaderstats.Clicks.Value += 1 end)
When i made a part called “Handle” and put it in the tool it worked, but when i used a model that i made in like 10 minutes and named it “Handle”, it just broke. It stayed in the place I made it in Roblox Studio and it was invisible. When i equipped the tool it made it visible again, and since it was not anchored every component just rolled arond
to find the leaderstats is posible. just put this script inside the activate function. make you have your leaderstats folder and clicks folder correct. local player = players:GetPlayerFromCharacter(tool.Parent) if player then local leadstats = player:FindFirstChild("leaderstats") if leadstats then local clicks = leadstats:FindFirstChild("clicks") if clicks then while isHolding do task.wait(WAIT_TIME) clicks.Value = clicks.Value + 1 tool.Handle.Color = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)) shootSound:Play() end end end end
i have a question how do i make the block luanch forwards and damage whatever player it touches? im thinking i chuld make this a skill can you make a vidoe about it? how to make something luanch and then damage like a gun?
here's my script! I'm really happy with how it turned out, learning how to make things happen when tools are activated, deactivated, etc. I'm also very happy I know how to import sounds from the toolbox, and I'm gonna do devious things with my friends using that. Thanks! local tool = script.Parent local toolDown = false local clicks = game.Players.LocalPlayer:WaitForChild("leaderstats"):FindFirstChild("Clicks") local handle = tool:FindFirstChild("Handle") local jumpscare = tool["Granny: Jumpscare (Game Over)"] local excitingSound = tool["Shadow Lands Sting"] tool.Equipped:Connect(function() jumpscare:Play() end) tool.Activated:Connect(function() print(clicks.Value) clicks.Value += 1 handle.Size = Vector3.new(clicks.Value, clicks.Value, clicks.Value) toolDown = true end) tool.Deactivated:Connect(function() toolDown = false end) while true do print("Player holding down the tool is", toolDown) local randomColor1 = math.random(0, 255) local randomColor2 = math.random(0, 255) local randomColor3 = math.random(0, 255) handle.Color = Color3.fromRGB(randomColor1, randomColor2, randomColor3) if handle.Color == Color3.fromRGB(69, 69, 69) then excitingSound:Play() end task.wait(1) end
heyy, I was struggling with the changing color challenge, cuz when i hold my button, the Handle part doesn't changing color, when i used your code, it doesn't work either. Why? Can you explain it please
bro that fifth challenge requirement had me fussing and then I caved and watched just for you to say to hard code it lmfaoo I'm like there's no actual way to grab that leaderstats value because there's no parameter for activating a tool that gives the player or character in any capacity.. needless to say im gunning for that remote event vid
Hey, do you know how to make tool that clones a model from server storage on click and places it in front of the player in roblox studio with cooldown of 20 seconds and also the models lifetime is 15 seconds?
i was able to do everytg except for the sound on my own. i even made it so that the block goes through different num values one by one , (1 , 2 , 3 , 4 , 4.5 , 5) , and changes color based on the redness, (the redness level increasing). all thx to u im able to do this! thx a lot!
I WAS TRYING FOR SO LONG HOW TO ADD CLICKS VARIABLE TO THE TOOL SCRIPT brooo and you ended up doing the simple workaround referring to specific player which I didnt wnna do 😭
Use getplayerfromcharacter To use it make a variable in activated that says the parent of the tool and since it’s part of your playermodel it’s gonna say “your username” And then use the getplayerfromcharacter and in () put the variable name and then you can go to clicks and do the thing where you add the click
question.. when I equip the tool. I get teleported to the tool which is on the ground when I created it and not the tool being in my hand.. why is this? :< Anchor is off too
After doing some looking around, nothing seems out of place. I copied everything from the new Place back into the old project (even tho they're literally identical) and it seems to still not work. The scripts only fully function once I copy everything into a new Place. Weird bug.
My script was normal and I believe it could be made better, if yes please tell me how: local tool = script.Parent local plr = tool.Parent.Parent local sound = tool.Sound local handle = tool.Handle local check = false tool.Equipped:Connect(function() sound:Play() end) tool.Activated:Connect(function() check = true tool:ScaleTo(2) plr.leaderstats.Clicks.Value += 1 while check == true do handle.Color = Color3.fromRGB(math.random(0,255), math.random(0,255), math.random(0,255)) wait(1) end end) tool.Deactivated:Connect(function() tool:ScaleTo(1) check = false end) tool.Unequipped:Connect(function() sound:Stop() end)
I don't fully understand the part where I want to make certain items/tools exclusive to me or people, how do I do this in script form? It worked when I tried the client/server side like in the video but how do I implement this :>
Hello! My name is Enrique. A pleasure. I have seen your videos and I am extremely delighted with them. I would like to know if you would like to work on developing an experience that is almost ready; What it really lacks is someone to bring it to life with the codes. If interested, let me know! I will be happy to give you more details. Many successes!
while true do if IsActivated == true then local R = math.random(1, 255) local G = math.random(1, 255) local B = math.random(1, 255) script.Parent.Handle.Color = Color3.new(R, G, B) task.wait(0.2) script.Parent.Deactivated:Connect(function() script.Parent:ScaleTo(1) IsActivated = false script.Parent.Handle.BrickColor = BrickColor.new("medium stone grey") end) else break end end end)
the challenge local tool = script.Parent local handle = tool.Handle local equipped = false function mudarcor() while equipped do handle.Color = Color3.new( math.random(), math.random(), math.random() ) wait(0.2) end end tool.Equipped:Connect(function(player) equipped = true mudarcor() end) tool.Unequipped:Connect(function() equipped = false end)
I made it where the longer you hold the more points you get and the bigger the pipe gets, Also put a bonk sound when deactivated. Thank you verymuch BrawlDev!! local pipe = script.Parent local pipeScale = 0.5 local isHeld = false pipe.Equipped:Connect(function() pipe.Equip:Play() end) pipe.Activated:Connect(function() isHeld = true pipe.Bigging:Play() while isHeld do pipe:ScaleTo(pipeScale + 0.001) pipeScale = pipeScale + 0.001 local RandomizedColor = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)) pipe.Handle.Color = RandomizedColor pipe.Handle.Head.Color = RandomizedColor task.wait() end end) pipe.Deactivated:Connect(function() game.Players:FindFirstChild("EULOVExPLAYZ").leaderstats.Hits.Value += pipeScale isHeld = false pipe.Bigging:Pause() pipe.Bonk:Play() pipeScale = 0.5 pipe:ScaleTo(0.5) end)
13:47 I acutally found a way to change the color when activating it! tool.Activated:Connect(function() local handle = tool:FindFirstChild("Handle") handle.BrickColor = BrickColor.new("Really red") end) tool.Deactivated:Connect(function() local handle = tool:FindFirstChild("Handle") handle.BrickColor = BrickColor.new("Medium stone grey") end)
BRO I SPENT AN HOUR TRYING TO DO THAT CHALLENGE CAUSE I had an issue where everything was working but the scale thing was crashing the game. Its cause i put the scaleto script INSIDE OF THE WHILE TRUE DO LOOP IM SUCH A MORON
Thought the 2nd guideline was saying to gradually increase the tool with every click and then start decreasing after a certain threshold. Made my life 5x harder but learned to follow instructions and at least gotten my skills refined a bit better 🥲 Used 3 scripts too.
okay so i didnt do leaderstats but i did the sound and i like it. local tool = script.Parent local handle = tool.Handle toolused = false tool.Activated:Connect(function() if toolused == false then toolused = true tool:ScaleTo(2) handle.BrickColor = BrickColor.Random() tool.vineboom:Play() end end) tool.Deactivated:Connect(function() if toolused == true then toolused = false tool:ScaleTo(1) handle.BrickColor = BrickColor.new("Cocoa") end end)
I just made a gun bang bang local gun = script.Parent local handle = gun.Handle local equipSound = handle.EquipSound local unequipSound = handle.UnequipSound local fireSound = handle.FireSound local countDownUntilReload = 5 gun.Equipped:Connect(function(mouse) equipSound:Play() task.wait(equipSound.TimeLength) end) gun.Unequipped:Connect(function(mouse) unequipSound:Play() task.wait(unequipSound.TimeLength) end) gun.Activated:Connect(function(mouse) fireSound:Play() task.wait(fireSound.TimeLength) countDownUntilReload = countDownUntilReload - 1
local tool = script.Parent --this creates a reference for the tool local handle = tool.Handle --this creates a reference for the handle local sound = tool.Static --this creates a reference for the sound local sound2 = tool.Bubble local isHolding = false local WAIT_TIME = 0.2 tool.Equipped:Connect(function() sound:Play() end) tool.Activated:Connect(function() print("clicked") sound2:Play() isHolding = true tool:ScaleTo(1.5)
while isHolding == true do --handle.Color = Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255)) handle.BrickColor = BrickColor.new("Really red") task.wait(WAIT_TIME) end
local tool = script.Parent local handle = tool.Handle local Swordequip = tool["Sword Sheath"] local Swordattack = tool["Knife Shing 102 (SFX)"] local isHolding = false --Equipped fires when a tool is equipped tool.Equipped:Connect(function() print("Tool equipped") Swordequip:Play() end) --Unequipped triggers when it is unequipped tool.Unequipped:Connect(function() print("Tool unequipped") end) --Activated event is triggered when a tool or object is used tool.Activated:Connect(function() print("Tool activated") Swordattack:Play() isHolding = true tool:ScaleTo(2) while isHolding == true do handle.Color = Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255)) task.wait(0.2) end game.Players:FindFirstChild("Beastyab_007").leaderstats.Clicks.Value += 1 end) --Deactivated occurs when it is no longer in use tool.Deactivated:Connect(function() print("Tool unactivated") handle.Color = Color3.fromRGB(163, 162, 165) isHolding = false tool:ScaleTo(1) end)
my version: local tool = script.Parent.Parent local Check = tool.Check local sound = tool.Notice4 local handle = tool.Handle Check.Value = false tool.Equipped:Connect(function() sound:Play() end) tool.Activated:Connect(function() local player = game.Players:GetPlayerFromCharacter(tool.Parent) local playerStats = player:FindFirstChild("leaderstats") local clicks = playerStats.Clicks
local tool = script.Parent local i = 0.5 local toolActivated = false tool.Equipped:Connect(function() print("This tool has been equipped") end) tool.Activated:Connect(function() toolActivated = true end) tool.Deactivated:Connect(function() toolActivated = false end) while true do if toolActivated == true then tool:ScaleTo(i) i+=0.5 else if( i == 0.5) then tool:ScaleTo(i) else i-=0.5 tool:ScaleTo(i) end end task.wait(0.6) end I have added no limit to how much the scale of the tool can increase, I accidentally Unequipped the tool while I was holding left click and it kept increasing in size, just not visible yet, I equipped it and I got flung into air because it was so big 💀 (I know I shouldn't have used while loop without an end.)
🟢MAKE SURE YOU WATCH MY BEGINNERS SCRIPTING SERIES FIRST BEFORE THIS ONE!
th-cam.com/play/PLQ1Qd31Hmi3W_CGDzYOp7enyHlOuO3MtC.html&si=6lWPfrILGGq1GLlW
Woah, your channel is one of the only ones that actually teaches you something useful and in a cool way!
Happy to hear that!
@@BrawlDevRBLX fr
another workaround for finding the player is simply doing this:
local player = game.Players:FindFirstChild(tostring(tool.Parent))
When a player is holding the tool, the tool's parent is the player in Workspace, so it takes that, turns it into a string, and finds it in game.Players.
great tutorial BTW
Smart 😮
to string doesnt work you need to do tool.Parent.Name
You can just do local player =tool.Parent.Parent
skibidi toilet
awesome comment it worked perfectly! To anyone having a mistake make sure you're not doing game.Workspace
Thanks for making this series, you’re the only one that posted an advanced series that’s not outdated!
thank you so much bro
that feeling when you understand eveyrthing brawl dev says in the challenge, i was rlly lost but god damn i caught up and im proud!!
dude your deadass the best tutorial maker ive ever watched, i went through like half your series and as of now im just applying what ive learned to my games and i cant express enough how much my scripting has changed because fo you, not one other tutorial has worked please keep making these
ANOTHER BANGER🥶🥶🥶
being able to complete the challenge on my own felt soooo good. Thanks for the great tutorials so far.
even I couldnt do it on my own the first time and im watching this entire series for the second time lmao. Nice bro
Super underrated series and TH-camr. This series is helping me further my knowledge a lot.
These tutorials are awesome so far!
I've wanted to get into scripting for a while now but never had the time to start. And now I'm on school holidays so I have time!
I also did the challenge. I was a bit stuck and got a little help from your script. But yeah here it is!
local tool = script.Parent
local handle = tool.Handle
local IsHolding = false
local Sound1 = script.Equip
local Sound2 = script.Unequip
tool.Equipped:Connect(function()
print("Tool has been equipped")
Sound1:Play()
end)
tool.Unequipped:Connect(function()
print("Tool has been unequipped")
IsHolding = false
tool:ScaleTo(1)
Sound2:Play()
end)
tool.Activated:Connect(function()
print("Tool has been activated")
IsHolding = true
tool:ScaleTo(1.8)
while IsHolding do
task.wait(0.1)
local r = math.random(0, 255)
local g = math.random(0, 255)
local b = math.random(0, 255)
handle.Color = Color3.new(r, g, b)
game.Players:FindFirstChild("BelugaLOLXDYT").leaderstats.Clicks.Value += 1
end
end)
tool.Deactivated:Connect(function()
print("Tool has been deactivated")
IsHolding = false
tool:ScaleTo(1)
while IsHolding == false do
task.wait(0.1)
handle.BrickColor = BrickColor.new("Medium stone grey")
end
end)
Thanks for the amazing tutorial, it helped me a lot!
FIRST COMMENT! Also yw!
i never thought i would learn scripting so fast like this, thx for the incredible tutorials
hey thanks for stopping by
Only 3 videos into this playlist, watching these even with out following along, it's quite easier to understand them some others.
I only know badics and cannot really do my own scripts other then simple part propertie changes and a touched.
Even though ive watched and followed along a few different series over the last few years. I don't do enough.
These videos are explained so well, thank you for going more in depth in a sense.
Can you please make a video about laying good groundworks. Usually my games turn into a million scripts with a trillion if statements.
Facts
Fux
SAME
Probably the best tutorial for tools on TH-cam
I love your videos!
You somehow can make me understand Roblox scripting! I say this because I have never programmed in my life (like in any prog. language).
Thanks again for these tutorials!
Most enjoyable video in the series so far, it was easy to understand and REALLY useful 😮
You could use the manual activation for a anvil and a hammer. If you press on the anvil the tool will activate and it will do something.
Question, in an RPG, let's say for example that you will have tens of different weapons. which of these is better/most optimal. Keep in mind that this RPG game would also have a trading system, so these weapons/items would be tradeable between players
1) create each weapon as a "Part" with their own textures, etc
2) create each weapon as a "Handle", and these handles would have their own texture, etc.
I love your channel so far! Please continue! Thanks for the amazing tutorials! 🎉
Yes indeed your tutorials are VERY helpful!
This is the best tutorials. I was able to make all 7 challenges in the other video + the bonus one and I also made that challenge about tools. I am so happy! TYSM.
very informative video and i love the challenges or tasks you give at the end really helps to fully engage and get hands on with what ive been taught this challenge was especially fun to do looking forward to your other videos!
Extremely helpful tutorial!!!
We really appreciate your lessons; your efforts will be rewarded.
damn this challenge thing is really helpful, it gives us an idea on how to implement the stuff we're learning
I used to change tutorials but yours are the best :D.
thank you brawldev you make this whole thing so achievable feeling
the day i needed a tutorial, i get it and its GOOOOD :)
you helped me alot of the tools tuto episode thanks :D
Quick workaround, it should work when another player picks the tool up since it re-defines the variable on the Equipped event.
tool.Equipped:Connect(function()
plrName = script.Parent.Parent
end)
tool.Activated:Connect(function()
game.Players:WaitForChild(plrName.Name).leaderstats.Clicks.Value += 1
end)
I learned baiscs with rodev and you feel like a cool continuation of my scripting career! It helps me SM ty!!!
we need more people like BrawlDev
Wow! This video is awesome. Your explanations are clear and you lay really good groundwork.
Please keep making these tutorials.
When i made a part called “Handle” and put it in the tool it worked, but when i used a model that i made in like 10 minutes and named it “Handle”, it just broke. It stayed in the place I made it in Roblox Studio and it was invisible. When i equipped the tool it made it visible again, and since it was not anchored every component just rolled arond
Great Video!!
I got the first 2 out of 5 lol but now I understand it way more
to find the leaderstats is posible. just put this script inside the activate function. make you have your leaderstats folder and clicks folder correct. local player = players:GetPlayerFromCharacter(tool.Parent)
if player then
local leadstats = player:FindFirstChild("leaderstats")
if leadstats then
local clicks = leadstats:FindFirstChild("clicks")
if clicks then
while isHolding do
task.wait(WAIT_TIME)
clicks.Value = clicks.Value + 1
tool.Handle.Color = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))
shootSound:Play()
end
end
end
end
I hope you include challenges like this at the end of every video
another way to get the player holding the tool from the server would be a line like this
script.Parent:FindFirstAncestorWhichIsA("Player")
i have a question
how do i make the block luanch forwards and damage whatever player it touches?
im thinking i chuld make this a skill can you make a vidoe about it? how to make something luanch and then damage like a gun?
here's my script!
I'm really happy with how it turned out, learning how to make things happen when tools are activated, deactivated, etc. I'm also very happy I know how to import sounds from the toolbox, and I'm gonna do devious things with my friends using that. Thanks!
local tool = script.Parent
local toolDown = false
local clicks = game.Players.LocalPlayer:WaitForChild("leaderstats"):FindFirstChild("Clicks")
local handle = tool:FindFirstChild("Handle")
local jumpscare = tool["Granny: Jumpscare (Game Over)"]
local excitingSound = tool["Shadow Lands Sting"]
tool.Equipped:Connect(function()
jumpscare:Play()
end)
tool.Activated:Connect(function()
print(clicks.Value)
clicks.Value += 1
handle.Size = Vector3.new(clicks.Value, clicks.Value, clicks.Value)
toolDown = true
end)
tool.Deactivated:Connect(function()
toolDown = false
end)
while true do
print("Player holding down the tool is", toolDown)
local randomColor1 = math.random(0, 255)
local randomColor2 = math.random(0, 255)
local randomColor3 = math.random(0, 255)
handle.Color = Color3.fromRGB(randomColor1, randomColor2, randomColor3)
if handle.Color == Color3.fromRGB(69, 69, 69) then
excitingSound:Play()
end
task.wait(1)
end
this was also done on a local script, so findfirstchild and waitforchild work
BRO U NEED TO ACTIVATE WINDOWS
🎁Get Access to my Scripts + More Perks by Becoming a Channel Member! 👇
www.youtube.com/@BrawlDevRBLX/join
That’s cool
you forgot to pin it
guys make sure to lift the "Handle" up from the ground a little bit before adding it to the Tool inside of the StarterPack.
thanks random guy, ive been having a mental breakdown for the last 2 days trying to figure out handle
i swear that i couldn't learn how to script perfectly from any youtuber exept you
heyy, I was struggling with the changing color challenge, cuz when i hold my button, the Handle part doesn't changing color, when i used your code, it doesn't work either. Why? Can you explain it please
My g u gotta activate windows!!! Fr though great tutorial and helpful for a noob dev like me.
bro that fifth challenge requirement had me fussing and then I caved and watched just for you to say to hard code it lmfaoo I'm like there's no actual way to grab that leaderstats value because there's no parameter for activating a tool that gives the player or character in any capacity.. needless to say im gunning for that remote event vid
ngl was doing this yesterday and i got really frustrated, just came back today and it was soo easy
Hey, do you know how to make tool that clones a model from server storage on click and places it in front of the player in roblox studio with cooldown of 20 seconds and also the models lifetime is 15 seconds?
lol spent like 30 minutes tryna figure out how to not hardcode the clicks before watching challenge explanation
i was able to do everytg except for the sound on my own. i even made it so that the block goes through different num values one by one , (1 , 2 , 3 , 4 , 4.5 , 5) , and changes color based on the redness, (the redness level increasing). all thx to u im able to do this! thx a lot!
Please don't change the leaderstats value only to your character like you did, that is going to make new scripters do it wrongly
Tht canBeDropped reminded me of all the one piece Roblox games😂
I WAS TRYING FOR SO LONG HOW TO ADD CLICKS VARIABLE TO THE TOOL SCRIPT brooo and you ended up doing the simple workaround referring to specific player which I didnt wnna do 😭
Use getplayerfromcharacter
To use it make a variable in activated that says the parent of the tool and since it’s part of your playermodel it’s gonna say “your username”
And then use the getplayerfromcharacter and in () put the variable name and then you can go to clicks and do the thing where you add the click
I hope my reply helped you
Another banger
i have a problem that , i cant change the color of a tool thats handle is union
question..
when I equip the tool. I get teleported to the tool which is on the ground when I created it and not the tool being in my hand.. why is this? :< Anchor is off too
what plugins do you use?
Whenever I equip the part my character is stuck and anchor is off
Issue: Everything works fine, but when I try to use tool.Activated:Connect(function(), it just doesn't work. Help?
Update: I just clicked "New" and copied everything into a new Place and it works. So confused right now.
After doing some looking around, nothing seems out of place. I copied everything from the new Place back into the old project (even tho they're literally identical) and it seems to still not work. The scripts only fully function once I copy everything into a new Place. Weird bug.
are you sure you didn't enable ManualActivation for the tool
its not working the leaderstats and the music one and the colour and clicks not working help
Can you explain Why I hold the tool, It's on the ground not in my hand?
The tool's handle may be anchored, make sure it isn't
@@BrawlDevRBLX thank you for answer, but Is the name related with tool?, because I changed part name into handle,and It actually worked.
@@user-engine24yeah, only works if the handle is named Handle
My script was normal and I believe it could be made better, if yes please tell me how:
local tool = script.Parent
local plr = tool.Parent.Parent
local sound = tool.Sound
local handle = tool.Handle
local check = false
tool.Equipped:Connect(function()
sound:Play()
end)
tool.Activated:Connect(function()
check = true
tool:ScaleTo(2)
plr.leaderstats.Clicks.Value += 1
while check == true do
handle.Color = Color3.fromRGB(math.random(0,255), math.random(0,255), math.random(0,255))
wait(1)
end
end)
tool.Deactivated:Connect(function()
tool:ScaleTo(1)
check = false
end)
tool.Unequipped:Connect(function()
sound:Stop()
end)
I don't fully understand the part where I want to make certain items/tools exclusive to me or people, how do I do this in script form? It worked when I tried the client/server side like in the video but how do I implement this :>
all I did was delete the weld for the part and it worked.
can you tell me why my parts are not saving?
"Allright, lets think about this for a minute!" 🤓☝
hey brawldev i love your chanle but nothing i do works i copy what you do and still get nothing
Hello! My name is Enrique. A pleasure. I have seen your videos and I am extremely delighted with them. I would like to know if you would like to work on developing an experience that is almost ready; What it really lacks is someone to bring it to life with the codes. If interested, let me know! I will be happy to give you more details. Many successes!
leaderstats:
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local Clicks = Instance.new("IntValue", leaderstats)
Clicks.Name = "Clicks"
Clicks.Value = 0
end)
Main:
local IsActivated = false
script.Parent.Activated:Connect(function()
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
script.Parent:ScaleTo(0.75)
player.leaderstats.Clicks.Value += 1
IsActivated = true
while true do
if IsActivated == true then
local R = math.random(1, 255)
local G = math.random(1, 255)
local B = math.random(1, 255)
script.Parent.Handle.Color = Color3.new(R, G, B)
task.wait(0.2)
script.Parent.Deactivated:Connect(function()
script.Parent:ScaleTo(1)
IsActivated = false
script.Parent.Handle.BrickColor = BrickColor.new("medium stone grey")
end)
else
break
end
end
end)
the challenge
local tool = script.Parent
local handle = tool.Handle
local equipped = false
function mudarcor()
while equipped do
handle.Color = Color3.new(
math.random(),
math.random(),
math.random()
)
wait(0.2)
end
end
tool.Equipped:Connect(function(player)
equipped = true
mudarcor()
end)
tool.Unequipped:Connect(function()
equipped = false
end)
Is it okay if i dont do the challenge
I made it where the longer you hold the more points you get and the bigger the pipe gets, Also put a bonk sound when deactivated.
Thank you verymuch BrawlDev!!
local pipe = script.Parent
local pipeScale = 0.5
local isHeld = false
pipe.Equipped:Connect(function()
pipe.Equip:Play()
end)
pipe.Activated:Connect(function()
isHeld = true
pipe.Bigging:Play()
while isHeld do
pipe:ScaleTo(pipeScale + 0.001)
pipeScale = pipeScale + 0.001
local RandomizedColor = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))
pipe.Handle.Color = RandomizedColor
pipe.Handle.Head.Color = RandomizedColor
task.wait()
end
end)
pipe.Deactivated:Connect(function()
game.Players:FindFirstChild("EULOVExPLAYZ").leaderstats.Hits.Value += pipeScale
isHeld = false
pipe.Bigging:Pause()
pipe.Bonk:Play()
pipeScale = 0.5
pipe:ScaleTo(0.5)
end)
Thanks i learnt now
13:47 I acutally found a way to change the color when activating it!
tool.Activated:Connect(function()
local handle = tool:FindFirstChild("Handle")
handle.BrickColor = BrickColor.new("Really red")
end)
tool.Deactivated:Connect(function()
local handle = tool:FindFirstChild("Handle")
handle.BrickColor = BrickColor.new("Medium stone grey")
end)
Helpful video, could you also make one about the :Connect the the other : Events or whatever it is. I dont really understand that
Check out my beginners scripting playlist, I should have an episode covering that!
Nice tutorial ! and i was wondering why i can't use GetPlayerFromCharacter to get the player
I got a error because leaderstats backpacks is nil somebody help
i need a lot of scripting to do
local tool = script.Parent
tool.Activated:Connect(function()
local clicked = false
while clicked == false do
local red = math.random(0, 255)
local green = math.random(0, 255)
local blue = math.random(0, 255)
local num1 = math.random(2, 6)
local num = num1/3
tool.Handle.Color = Color3.fromRGB(red, green, blue)
tool:ScaleTo(num)
clicked = true
end
end)
BRO I SPENT AN HOUR TRYING TO DO THAT CHALLENGE CAUSE
I had an issue where everything was working but the scale thing was crashing the game.
Its cause i put the scaleto script INSIDE OF THE WHILE TRUE DO LOOP IM SUCH A MORON
"Mistakes are how we learn, you can't be good at something without making mistakes" - wise man
local tool = script.Parent
local handle = script.Parent:FindFirstChild("Handle")
tool.Equipped:Connect(function()
print("this tool has been equipped")
end)
tool.Activated:Connect(function()
while true do
handle.Size = handle.Size * 1.15
handle.Color = Color3.fromRGB(math.random(0,255), math.random(0,255), math.random(0,255))
handle.Transparency = math.random(0.1,0.8)
wait(1)
end
end)
Thought the 2nd guideline was saying to gradually increase the tool with every click and then start decreasing after a certain threshold. Made my life 5x harder but learned to follow instructions and at least gotten my skills refined a bit better 🥲 Used 3 scripts too.
okay so i didnt do leaderstats but i did the sound and i like it.
local tool = script.Parent
local handle = tool.Handle
toolused = false
tool.Activated:Connect(function()
if toolused == false then
toolused = true
tool:ScaleTo(2)
handle.BrickColor = BrickColor.Random()
tool.vineboom:Play()
end
end)
tool.Deactivated:Connect(function()
if toolused == true then
toolused = false
tool:ScaleTo(1)
handle.BrickColor = BrickColor.new("Cocoa")
end
end)
I just made a gun bang bang
local gun = script.Parent
local handle = gun.Handle
local equipSound = handle.EquipSound
local unequipSound = handle.UnequipSound
local fireSound = handle.FireSound
local countDownUntilReload = 5
gun.Equipped:Connect(function(mouse)
equipSound:Play()
task.wait(equipSound.TimeLength)
end)
gun.Unequipped:Connect(function(mouse)
unequipSound:Play()
task.wait(unequipSound.TimeLength)
end)
gun.Activated:Connect(function(mouse)
fireSound:Play()
task.wait(fireSound.TimeLength)
countDownUntilReload = countDownUntilReload - 1
if countDownUntilReload
i made a cookie clicker ma man les goo
with all respect
wasted more then 1 hour watching this video cuz i watched it twice
don't use "Players: findfirstchild("yourname"). just put local player = tool.Parent.Parent
local tool = script.Parent --this creates a reference for the tool
local handle = tool.Handle --this creates a reference for the handle
local sound = tool.Static --this creates a reference for the sound
local sound2 = tool.Bubble
local isHolding = false
local WAIT_TIME = 0.2
tool.Equipped:Connect(function()
sound:Play()
end)
tool.Activated:Connect(function()
print("clicked")
sound2:Play()
isHolding = true
tool:ScaleTo(1.5)
while isHolding == true do
--handle.Color = Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255))
handle.BrickColor = BrickColor.new("Really red")
task.wait(WAIT_TIME)
end
game.Players:FindFirstChild("NAME").leaderstats.Clicks.Value += math.random (5, 100)
end)
tool.Deactivated:Connect(function()
isHolding = false
tool:ScaleTo(1)
handle.BrickColor = BrickColor.new("Medium stone grey")
end)
local tool = script.Parent
local handle = tool.Handle
local Swordequip = tool["Sword Sheath"]
local Swordattack = tool["Knife Shing 102 (SFX)"]
local isHolding = false
--Equipped fires when a tool is equipped
tool.Equipped:Connect(function()
print("Tool equipped")
Swordequip:Play()
end)
--Unequipped triggers when it is unequipped
tool.Unequipped:Connect(function()
print("Tool unequipped")
end)
--Activated event is triggered when a tool or object is used
tool.Activated:Connect(function()
print("Tool activated")
Swordattack:Play()
isHolding = true
tool:ScaleTo(2)
while isHolding == true do
handle.Color = Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255))
task.wait(0.2)
end
game.Players:FindFirstChild("Beastyab_007").leaderstats.Clicks.Value += 1
end)
--Deactivated occurs when it is no longer in use
tool.Deactivated:Connect(function()
print("Tool unactivated")
handle.Color = Color3.fromRGB(163, 162, 165)
isHolding = false
tool:ScaleTo(1)
end)
What if someone do color rng🤣🤣 ? Like if color was 255,255,255 all the time of cycle, you getting badge
bodyvelocity when?
23:41
local player = tool.Parent.Name
game.Players:FindFirstChild(player).leaderstats.Clicks.Value += 1
my version:
local tool = script.Parent.Parent
local Check = tool.Check
local sound = tool.Notice4
local handle = tool.Handle
Check.Value = false
tool.Equipped:Connect(function()
sound:Play()
end)
tool.Activated:Connect(function()
local player = game.Players:GetPlayerFromCharacter(tool.Parent)
local playerStats = player:FindFirstChild("leaderstats")
local clicks = playerStats.Clicks
clicks.Value += 1
Check.Value = true
tool:ScaleTo(2)
while Check.Value == true do
handle.Color = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
task.wait(.5)
end
end)
tool.Deactivated:Connect(function()
Check.Value = false
tool:ScaleTo(1)
end)
That was surprising easy
local tool = script.Parent
local i = 0.5
local toolActivated = false
tool.Equipped:Connect(function()
print("This tool has been equipped")
end)
tool.Activated:Connect(function()
toolActivated = true
end)
tool.Deactivated:Connect(function()
toolActivated = false
end)
while true do
if toolActivated == true then
tool:ScaleTo(i)
i+=0.5
else
if( i == 0.5) then
tool:ScaleTo(i)
else
i-=0.5
tool:ScaleTo(i)
end
end
task.wait(0.6)
end
I have added no limit to how much the scale of the tool can increase, I accidentally Unequipped the tool while I was holding left click and it kept increasing in size, just not visible yet, I equipped it and I got flung into air because it was so big 💀 (I know I shouldn't have used while loop without an end.)
20:13
A