Merry Christmas Gnomes! Hope you're all well. There will be a short break in the episodes during the holiday but we'll be back to work soon!
@PineBloxx
2 жыл бұрын
Merry Christmas Gnome! You deserve a break! Congratulations for a great year and have a great holiday!!
@that1gamerlad98
2 жыл бұрын
Merry Christmas Gnome! Have a nice time and enjoy!
@Theroijr
2 жыл бұрын
That’s ok because it’s Christmas I was wondering if you can help me and my friend with a game we’re working on
@candykid44
2 жыл бұрын
merry chrysler
@tricky6614
2 жыл бұрын
marry christmas ❤😍😘🥰
@christianhelle
2 жыл бұрын
These videos are really great. I'm building a similar game together with my 10 year old son and your way of explaining is so much better and beginner friendly than my way. I'm a developer myself and have been for the last 20 years, but I have close to zero teaching experience. This has been very helpful for my son which tries to watch these on his own. Thanks a ton for publishing these
@ramz8462
2 жыл бұрын
damn u a good dad
@yariop5381
2 жыл бұрын
yes goood dad frl no cap
@castipro
2 жыл бұрын
Do you know why my tower doesnt place properly? I mean, it places but not where it should be
@imstilllandon2922
Жыл бұрын
W dad
@Frostnaut50_official
Жыл бұрын
W dad
@user-Aceproductions
Жыл бұрын
For anyone who’s code says depreciated it is because blacklist was removed from the game. Replace the word blacklist with exclude and it will work
@slobberyflame19
Жыл бұрын
Mine still don’t work
@slobberyflame19
Жыл бұрын
Nvm it work now
@catgaming512
Жыл бұрын
thanks for the help, i wondered why it didnt work
@yicewie
Жыл бұрын
@@slobberyflame19 what did you do?
@ObliviousNoob1
Жыл бұрын
Yo bro your A w
@z_n.
Жыл бұрын
Guys, "Blacklist" is now deprecated. So, instead of "Blacklist", it's "Exclude" im pretty sure. Just read it from a devforum.
@TotoDevRBLX
10 ай бұрын
Yeah its good
@spriteman1925
10 ай бұрын
If something is deprecated itll show it and then if you hover on it itll tell you what to do to make it up to date
@FrozenWater-real
10 ай бұрын
I still did blacklist and it worked but it didn’t show anything in the update too, so I’ll still use blacklist.
@spriteman1925
10 ай бұрын
@FrozenWater-ce8jn if you dont use exclude your game is going to break within a year
@spriteman1925
10 ай бұрын
@@FrozenWater-realor later idek just dont use it
@0_Shadow_1
Жыл бұрын
For anyone making Towers R6 make it like this local x = result.Position.X local y = result.Position.Y + TowerToSpawn["Left Leg"].Size.Y + (TowerToSpawn.PrimaryPart.Size.Y/2) local z = result.Position.Z And set HipHeight to 0 if your tower floats in the air (for small towers)
@OnePiece_Editz.
Жыл бұрын
TYSM
@gregthepolicespuppetreacts2135
Жыл бұрын
Thank you! You helped alot
@etudordismount7726
Жыл бұрын
THX SO MUCH IT WAS FLYING IN THE AIR
@etudordismount7726
Жыл бұрын
U HELPED ME I LIKE
@jolt5059
11 ай бұрын
thanks bro. you are a true guy fam.
@ThickLlama
3 күн бұрын
you are the best roblox tutorial youtuber ever! Why you might ask? 1# He gets straight to the point and doesn't go on about his merch for half the vid. 2# Explains everything to people like me who don't know scripting very well *:P*. Get this guy to 1m subs he deserves! (edit) oh and also barely any ads like cmon if your not subbed to this guy do it *NOW*
@Splffo
2 жыл бұрын
Nice tutorial man! it sure took me a long time to fix the mistakes i wrote inside the script. But the game is turning into a real tower defense game!
@Frontline100
10 ай бұрын
bro the update ruined the developing for my game
@Fabi-ch8sz
10 ай бұрын
@@Frontline100Do u can place multiple Towers?
@Mymuss
Ай бұрын
Guys I have a big problem My tower collides with me and after click it doesnt spawn
@HurelyDev
2 жыл бұрын
back again for another tip! heres how to make a tower that spawns units: 1: make a units folder in replicatedstorage, make a unit. 2: make a script in its humanoid and put this in it: local map = workspace.Daycare -- replace daycare with your map -- do it for how much waypoints you have script.Parent:MoveTo(map.Waypoints["9"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["8"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["7"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["6"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["5"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["4"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["3"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["2"].Position) script.Parent.MoveToFinished:Wait() script.Parent:MoveTo(map.Waypoints["1"].Position) script.Parent.MoveToFinished:Wait() next, if there is a script in its humanoidrootpart, replace it with this: script.Parent.Touched:Connect(function(hit) local plr = game.Players.LocalPlayer if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= "Mini-Purple" then -- replace Mini-Purple with your units name hit.Parent.Humanoid.Health -= 2 script.Parent.Parent:Destroy() end end) Next, put this script in the tower that will spawn the units: local tower = script.Parent.Parent local mobs = workspace.Mobs local function FindNearestTarget() local maxDistance = 50 local nearestTarget = nil for i, target in ipairs(mobs:GetChildren()) do local distance = (target.HumanoidRootPart.Position - tower.HumanoidRootPart.Position).Magnitude if distance < maxDistance then nearestTarget = target maxDistance = distance end end return nearestTarget end local function SpawnUnit() local unit = game.ReplicatedStorage.Units["Mini-Purple"]:Clone() -- replace Mini-Purple with your units name unit.Parent = workspace.Towers unit.HumanoidRootPart.CFrame = workspace.Daycare.Waypoints["9"].CFrame -- replace it with the last waypoint on your map end while true do task.wait(2) local target = FindNearestTarget() if target then target.Humanoid.Health -= 3 end wait(1) SpawnUnit() end Now your done!
@ownerthegamer1218
2 жыл бұрын
Thank you
@ownerthegamer1218
2 жыл бұрын
Sorry but it says "HumanoidRootPart is not part of workspace" how do I fix that?
@ownerthegamer1218
2 жыл бұрын
Can you tell me how to do all of this? I might have messed something up
@HurelyDev
2 жыл бұрын
@@ownerthegamer1218 do you have discord
@ownerthegamer1218
2 жыл бұрын
@@HurelyDev yes Owner_Pro1#0988
@bloxingz168
Жыл бұрын
if you want to fix off hight of the tower just change hiphight of humanoid to -0.5 and in script change it too 1 for small towers like tds 😃
@systemerroryt1967
10 ай бұрын
how? (Nvm i found out)
@TheREALceren
2 жыл бұрын
Tip: If you want a grid, use local x = math.floor(result.Position.X) local y = math.floor(result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y / 2)) local z = math.floor(result.Position.Z)
@Emil_Jansson
2 жыл бұрын
math.round is more correct in this case and no need to do it on the y-axis.
@TheREALceren
2 жыл бұрын
@@Emil_Jansson yeah i dont know that math.round existed im sorry
@qwerty_qwerty
2 жыл бұрын
this broke my script 😃
@ALocalMaid
Жыл бұрын
@@qwerty_qwerty Don't trust random code that doesn't tell you what to do with it
@kekefufu2748
Жыл бұрын
Yo this works so well thanks man
@shahanawahid8797
2 жыл бұрын
Absolutely brilliant tutorial. Youre very easy to understand what everything is and why we need it. Thank you.
@mrnoobyt3328
Жыл бұрын
Collision Fix: If you still collide with your towers (can't walk through them) then, move your tower to workspace and unanchor it and anchor it again and put it back into the towers folder in replicatedstorage
@thatonekittykat
Жыл бұрын
I unanchored everything with an anchor enable/disable, still wont collide.
@trafed898
Жыл бұрын
Ah me too
@mrnoobyt3328
Жыл бұрын
@@trafed898 you fixed it?
@trafed898
Жыл бұрын
@@mrnoobyt3328 no
@LardonDash
Жыл бұрын
Hello guys ! can anyone help me pls ? my troup do not spawn where i click he spawn in its default workspace location ! (and I watched the video 5 times (at least) and I'm still blocked)(And (last time) there's no error so I can't correct it(yeah it's long sorry).)
@baconsplayz8079
2 жыл бұрын
Thanks for teaching us and this improved my building skills, Thank you for the help and stuff.
@skibungleskog
6 ай бұрын
for those of you having the same issue i was having, if your character is still in the ground when you spawn it in, spawn a part at the bottom of the legs, so its colliding with the legs, move the legs to where the torso should be and move the torso, arms, and head up so it looks like it should normally, then get rid of the part. thats what i did and it works.
@Mymuss
Ай бұрын
Hi! Can you help me? Im doing this episode for 3 days and I cant finish it because I have a 2 problems. My tower still collides with me and When I click my tower doesnt spawn (That green and red aura disappears ) Please help😢
@stefotheguy2766
2 жыл бұрын
15:45 Warning flying gnomes have been spotted around the globe you can't run or hide they will find you
@Panda-vm1vm
2 жыл бұрын
And they have slingshots
@thebluedemon168
2 жыл бұрын
@@Panda-vm1vm true
@flopperplayz6776
Жыл бұрын
I don't want to to to DIE!!!!!!!!
@flopperplayz6776
Жыл бұрын
Ggggggggggggg
@LeftyWithPuppetEditz
Жыл бұрын
I dont wanna die!
@tinpothead6586
2 жыл бұрын
This is very good! I have some suggestions for future episodes: Modes, Animations, Tower Settings (set tower to first, strongest, closest, etc. ), Appearance changes in upgrades Edit: Maybe even make a shop of towers if you can
@RedLogged
2 жыл бұрын
it isnt like he was most likely was gonna do this due to the fact that basically every tower defense game has this, not really and original idea but its normal in a tower defense game
@alexanderholmgaardlindholt4922
2 жыл бұрын
@@RedLogged the first tower defense game on Roblox does not have Tower Settings Edit: Many others don't too, even the first Tower Defense Game made. (out of roblox)
@Nachoegg
2 жыл бұрын
He already did a video about Animations its the part 3
@tinpothead6586
2 жыл бұрын
@@Nachoegg tower animations
@Nachoegg
2 жыл бұрын
@@tinpothead6586 oh ok well he only did mob animations in part 3 but good idea
@DegoArt-vk7yx
3 ай бұрын
00:03 Implement tower placement system. 02:10 Moving Tower Placement Code to Game GUI 06:48 Creating and testing tower placement in Tower Defense game 09:15 Setting tower position using coordinates 13:38 Setting up tower spawn parameters for proper placement 15:43 Adjusting character position with offset for proper alignment 19:30 Setting material type to force field for translucent effect 21:19 Using remote events to communicate between client and server 25:08 Checking tower existence and spawning it on the server 27:06 Completion of tower module script and connection to remote event 30:57 Limit tower placement to specific areas 32:49 Setting up tower placement and control in the script 36:25 Placement of towers is restricted to specific areas on the map. 38:14 Demonstrating tower rotation in Tower Defense game development.
@minebabo
2 ай бұрын
ty
@YeorgeX
Жыл бұрын
If you are having problems with the hipheight on your r6 character then go to the render stepped function and at the y position where it says local y = result.Position.Y + tower to spawn.Humanoid.Hipheight then in front of it add + 1 + (towerToSpawn.PrimaryPart.Size.Y /2) and set the hipheight for the humanoid to 0 in your character.
@anxerx4186
Жыл бұрын
thx it fixed my hipheight bug!
@YeorgeX
Жыл бұрын
@@anxerx4186 np.
@cobaltzero
8 ай бұрын
for me * 2 worked as well
@YeorgeX
8 ай бұрын
@@cobaltzero Ye, bc u used r15
@Neonnz409
7 ай бұрын
Hey bro for me ita still in the ground to place how do i fix it
@BucketBloxxer
2 жыл бұрын
This is so good! Keep up the tower defense tutorials gnomecode!
@CookerX32
2 жыл бұрын
*snoper*
@Trazor_
2 жыл бұрын
snoop
@BucketBloxxer
2 жыл бұрын
merry christmas eve everyone!
@Vapro4
23 сағат бұрын
I do not know how to fix it. my code stops after the tower was cloned and moved to the workspace, nothing else, I followed everything in this video, but the code just stops and stops working
@RichRBLX
2 жыл бұрын
your tutorials are great gnome, im on holiday but when i get back i'll continue on this series since ive only done the first 2 episodes :/
@EnderVampire
2 жыл бұрын
Hey Gnome! Definitely continue this series because it definitely is amazing, and you do a really good job on explaining the more complex things in coding, but I've been looking everywhere for a tutorial or even something to help me make a game like Phasmophobia or even a really good already made Roblox version called "Specter," so if you can help me make a game like this, I would greatly appreciate it. Keep making amazing vids!
@danix_toe_alt
10 ай бұрын
make it yourself
@iamnotastickman
3 ай бұрын
@@danix_toe_alt rude.
@holyradush
2 ай бұрын
congrats to anyone who finished this big episode 👏
@vanmtcn
Ай бұрын
thanks but i can't
@cybecc
2 жыл бұрын
at the line 52, here is the actual line: local y = result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y * 1.5)
@yazanzy
2 жыл бұрын
THANKS SOOOOO MUSH
@gpro1773
Жыл бұрын
It goes a lil bit higher than normal, but it helped me fix a bug. Thanks!
@baguettelord9741
9 ай бұрын
Yes, and make sure that hipheight is 0 and not 2
@jamesgamertime435
9 ай бұрын
Thank you
@noobgaming0216
2 жыл бұрын
Nice tutorial video, try doing a tower that spawns an ally (ex, military base spawns humvee)
@bihits5ire
Жыл бұрын
Humanoid is not a valid member of Model "Workspace.Towers.Cowboy". It keeps saying this for when I want the tower to stay on the ground and i cant fix it. Please help
@foxydev5551
2 жыл бұрын
Thank you!!! I’ve been looking for a good tutorial for a while now. One thing that you should do soon, is tower animations and a lobby with teleports to the maps for multiplayer..? Maybe a shop with currency too. Just suggestions!
@rblxhellsky
2 жыл бұрын
he will do it just for later episodes
@typicalaverage
2 жыл бұрын
So for those who want to make hidden enemies *actually* work, this is how First, you add a configuration folder into *every* single zombie you made, and rename it to "Attributes" or whatever you want. Next, add a BoolValue and rename it to "Hidden". After that, go to your tower and in the "if target then" script, add if target.Attributes.Hidden.Value == false then target.Humanoid:TakeDamage(1) end And for those whom want to make their towers an ACTUAL npc and make them work, here's the script i used (thanks to another guy for letting me know how to make towers face the enemy (PUT THE SCRIPT IN HUMANOIDROOTPART) local tower = script.Parent.Parent local mobs = workspace.Mob local part = script.Parent local function FindNearestTarget() local maxDistance = 25 local nearestTarget = nil for i, target in ipairs(mobs:GetChildren()) do local distance = (target.HumanoidRootPart.Position - tower.HumanoidRootPart.Position).Magnitude if distance < maxDistance then nearestTarget = target maxDistance = distance end end return nearestTarget end while true do local target = FindNearestTarget() if target then target.Humanoid:TakeDamage(1) else end task.wait(0.1) end Hope it worked! :D
@chronos3370
2 жыл бұрын
thx i didnt used but i think imma use it :D
@typicalaverage
2 жыл бұрын
I forgot the humanoid facing part but that's in the next episode, oh well!
@DustedMain
2 жыл бұрын
i cant seem to make it so that specific towers CAN see hidden
@wither7293
2 жыл бұрын
Can you make that its LIKE with the updated tower script
@goofymemer_1
2 жыл бұрын
now I want a tower that can attack hiddens
@Dafk1820
Жыл бұрын
This tutorial helped me a lot with my tower defense game! thanks gnomecode!
@zoombie251
10 ай бұрын
Dunno if im stupid or if its the code but im getting to about 19:00 in the video and after he does the forcefield effect and places it, it works for him, but not for me. I dont know what im doing wrong but I’ve double checked my code a stupid number of times with no fix. The tower doesn’t even appear anymore. Help would be appreciated!! (btw the tower doesnt even make it to the towers folder and the code stops around the part where its being cloned, i’ve tried printing but that aint working either)
@romasox9097
9 ай бұрын
hi! here is full script local PhysService = game:GetService("PhysicsService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Runservice = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local events = ReplicatedStorage:WaitForChild("Events") local towers = ReplicatedStorage:WaitForChild("Towers") local SpawnTowerEvent = events:WaitForChild("SpawningTower") local camera = workspace.CurrentCamera local gui = script.Parent local towerToSpawn = nil local function MouseRaycast(exclude) local mousePosition = UserInputService:GetMouseLocation() local mouseRay = camera:ViewportPointToRay(mousePosition.X , mousePosition.Y) local raycastParams = RaycastParams.new(exclude) raycastParams.FilterType = Enum.RaycastFilterType.Exclude raycastParams.FilterDescendantsInstances = exclude local raycastResult = workspace:Raycast(mouseRay.Origin, mouseRay.Direction * 1000, raycastParams) return raycastResult end local function APTower(name) local towerExists = towers:FindFirstChild(name) if towerExists then towerToSpawn = towerExists:Clone() towerToSpawn.Parent = workspace.Towers for i, object in ipairs(towerToSpawn:GetDescendants()) do if object:IsA("BasePart") then object.CollisionGroup = ("Tower") object.Material = Enum.Material.ForceField end end end end gui.Spawn.Activated:Connect(function() APTower("Baker") end) UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if towerToSpawn then if input.UserInputType == Enum.UserInputType.MouseButton1 then SpawnTowerEvent:FireServer(towerToSpawn.Name, towerToSpawn.PrimaryPart.CFrame) end end end) Runservice.RenderStepped:Connect(function() if towerToSpawn then local result = MouseRaycast({towerToSpawn}) if result and result.Instance then local x = result.Position.X local y = result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y / 2) local z = result.Position.Z local cFrame = CFrame.new(x, y, z) towerToSpawn:SetPrimaryPartCFrame(cFrame) end end end) (its working)
@CarpitalLetters
Ай бұрын
im having same problem 😭
@WavenadoDaTornado
10 күн бұрын
same
@enb6720
2 жыл бұрын
R6 Models have a default HipHeight of 0, to fix this change it to 2 in the Humanoid settings in your Tower model. :)
@SD-uv5bk
2 жыл бұрын
THANKS!
@sraiaan
2 жыл бұрын
there is a flaw to this, and thats that when the tower spawns, it will be floating. i cant find a way to fix it
@SD-uv5bk
2 жыл бұрын
@@sraiaan same this has happened to me, so I just switched the tower to R15… I’m sure there is a way to fix it with R6 but I am not aware of it
@yea152
2 жыл бұрын
@@sraiaan unanchor your primary part, it adjusts itself to the ground and on later levels anchor the humanoidrootpart so it stays still.
@ThatOneTechy
2 жыл бұрын
@@sraiaan Do this: local y = result.Position.Y + towerToSpawn.Humanoid.HipHeight + 1.44 + (towerToSpawn.PrimaryPart.Size.Y / 2) this spawns its at the right without making it float. (Replace 1.44 with your characters leg height
@EnchantedRowlet
11 ай бұрын
I copied the script and it still collides with me what do i do? (19:48)
@Mymuss
Ай бұрын
I have same problem
@Tealenn
7 ай бұрын
This was a big one, thank you gnome for a good tutorial!
@lordwigstyle8017
2 жыл бұрын
He didnt mention this but if you are using a model, not just a part use this in towertesting: local distance = (target.HumanoidRootPart.Position - tower.HumanoidRootPart.Position).Magnitude
@FrazdYT
2 жыл бұрын
at WHAT LINE
@roboticgames2989
Жыл бұрын
@@FrazdYT bruh if you see a local that means its a variable and local distance so replaces what local distance is with that
@safetysignfigure
3 ай бұрын
@@roboticgames2989 that was like 2 parts ago
@hypergamer5392
2 жыл бұрын
Thank you for the video! I added some extra things to the script like when you press x it withdraws the tower and I also added a custom health bar can't wait for more videos!
@GnomeCode
2 жыл бұрын
Nice work!
@alexanderholmgaardlindholt4922
2 жыл бұрын
VERY simple, but nice work yea.
@Scorpio894
2 жыл бұрын
How do I do that I would really love to where do I add it in
@Scorpio894
2 жыл бұрын
@@alexanderholmgaardlindholt4922 do you know how to do that I would like to
@oskargd1220
2 жыл бұрын
@@Scorpio894 Just learn scripting. Search up pea factory, how are you gonna add more to the game once he finishes the tutorial? Your game will just die.
@CRAPPYMANGOD
2 ай бұрын
Guys if you make the towers to be R6 and small make it like this (FIXED) local x = result.Position.X local y = result.Position.Y + towerToSpawn["Left Leg"].Size.Y + (towerToSpawn.PrimaryPart.Size.Y/0.4) local z = result.Position.Z if its still sinking make it 0.4 - 2 and find which is the perfect one :)
@CRAPPYMANGOD
2 ай бұрын
Also make it 0 HipHeight
@PierceGriffin2.7
2 ай бұрын
hey can you give me the time stamp for this code
@PierceGriffin2.7
2 ай бұрын
@@CRAPPYMANGOD thx
@Polievka
28 күн бұрын
THANK YOU SO MUCH
@garbagemunki4365
17 күн бұрын
This is groping around in the dark ... you're just making up numbers until it looks right. There are dimensions from your model you can use to get it right.
@zyreth0
2 жыл бұрын
This is a very good tutorial! I learned many new things :D
@Parock_mapping
Ай бұрын
if you have a problem with tower collision: for i, Part in ipairs(towerToSpawn:GetDescendants()) do if Part:IsA("BasePart") then Part.CollisionGroup = "Tower" Part.Material = Enum.Material.ForceField end end
@Richiemine01
Ай бұрын
Do u know how to fix an error that says "Requested module experiencied an error while loading" the script in Main that says. local tower = requiere(script.Tower)
@Parock_mapping
Ай бұрын
@@Richiemine01 sorry, but im not in home now i will help you tommorow
@xG0XBER
Ай бұрын
@@Parock_mapping how did u fix the collision group
@Parock_mapping
Ай бұрын
@@Richiemine01 you must have "return (name of parent script), Main " at the end of the script so, "return Main" 
@Parock_mapping
Ай бұрын
@@xG0XBER does the collision group work for you?
@Fishingman0101
5 күн бұрын
if your tower still keep flying towards you, even after u made the raycast correctly, make sure to add the raycastParams variable in this line: local raycastResult = workspace:Raycast(mouseRay.Origin, mouseRay.Direction * 1000, raycastParams)
@magmaxton
2 жыл бұрын
Amazing work! I have a question, will you make tower animations?
@livestats766
2 жыл бұрын
I think yes. Because he needs to work the towers more.
@GnomeCode
2 жыл бұрын
Yep, will be in episode 7
@thuytrangoan2508
2 жыл бұрын
Pog
@livestats766
2 жыл бұрын
@@mijott it will be delayed maybe 1 day or 2,he sayed it in the comments
@nexoshez
2 жыл бұрын
Can the next video have mobile support and/or console support? cause my friends cant access much - Fixed! heres if you need mobile support (put in GameController) function TouchLongPress(TouchPositions, state, gameProcessedEvent) if canPlace then spawnTowerEvent:FireServer(towerToSpawn.Name, towerToSpawn.PrimaryPart.CFrame) RemovePlaceholderTower() end end UserInput.TouchLongPress:Connect(TouchLongPress)
@sukiyaki4623
2 жыл бұрын
how would i do this?
@nexoshez
2 жыл бұрын
@@sukiyaki4623Put the script part under the UserInputService.InputBegan function. this is to place towers on mobile
@angomango173
8 ай бұрын
Honestly this series is made so well it deserves a subscribe. Lets get this guy to 100K!
@yukys1
6 ай бұрын
For real man I just made my own td called zombie tower defense
@angomango173
6 ай бұрын
@@yukys1 ok
@angomango173
6 ай бұрын
@@yukys1 no advertisements
@yukys1
6 ай бұрын
Nice
@GoatedTsbPlayer
Ай бұрын
Ur wish came true
@donofr666
Жыл бұрын
i have a problem when i click where i want to place my tower it just go in the original spot that it was even the other tower go there so it stack in one place i dont konw if its because i dont use a humanoid edit: i solved it it was because the primary part is inside the other part
@TheOhioMonkey
7 ай бұрын
how did u solve it?
@donofr666
7 ай бұрын
@@TheOhioMonkey i changed the primary part to be the one with the other one in it
@youraveragecuber101
4 ай бұрын
can i pls see your code i am really stuck on how to fix it
@PurpleBeanIscool
Ай бұрын
@@donofr666 what other part
@hazzaboy7274
26 күн бұрын
@@donofr666 bro that makes 0 sense
@harryxd8141
Жыл бұрын
the collision with mobs dosent work mobs cant walk past my slinger
@bradar
15 күн бұрын
something not working in "game controller' in "16" please who can tall me what am need to do?
@Vapro4
23 сағат бұрын
I do not know, it does not work for me either. Have you found a way to fix this? I really need it now.
@KoolKiwi_
Жыл бұрын
I recently encountered a problem where my gun wouldn't stick to my tower. I later figured out that I had to un-anchor it and I also made it a union to keep it more neat. I hope this helps you all!
@BhroaaFN
Жыл бұрын
The comment i needed to hear
@cosmix2711
Жыл бұрын
I did that but for some reason now it just falls off Edit: btw I have r6 model
@cosmix2711
Жыл бұрын
Like it just falls to the ground instead of sticking to it
@KoolKiwi_
Жыл бұрын
is it un-anchored and everything?@@cosmix2711
@Comptoon
Жыл бұрын
@@cosmix2711 (if you use the dfeault roblox animator) make the animation without the gun (i suggest duplicating it in case something rong happens) then after you finished the animation, rig the model with the weapon (because more motor parts causes error on roblox animator). [idk if i am right but..]
@Lexii.lindsay3569
Жыл бұрын
This playlist is literally the equivalent to classes people pay to get about game development and such, this is straight up a blessing
@dandinzin
Жыл бұрын
Yes, the series is really great just finished it And I see your comment is recent, if you are just starting out, good luck and have fun!
@meg-michelle
Жыл бұрын
do you know if the tower placing works for mobile users too?
@dandinzin
Жыл бұрын
It does, later in the series gnome code goes into mobile support, but the ray cast works@@meg-michelle
@Fonzi2
Жыл бұрын
@@dandinzin Hey can you help me, whenever I go to place a unit it shows its on the ground but then it spawns in the air about 1 to 2 studs up, pls help
@ThatoneguyTDS
10 ай бұрын
"straight up blessing"💀💀💀💀💀
@Richiemine01
Ай бұрын
For those who doesnt work check that in lines 16 and 17 the first raycastParams is writren correctly (with lower case r)
@muaytu
26 күн бұрын
yeah thxs for nothing we have eyes and when were you such an expert you can't even spell written correctly
@chunkyfunkymonkey
2 жыл бұрын
if you want the height offsett fixed with r6 use + towerToSpawn.Humanoid.HipHeight + 2 + (towerToSpawn.PrimaryPart.Size.Y / 2) instead of + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y / 2) make sure ur rigs hip height is 0 if you wish to do this.
@eduardobrtx3587
2 жыл бұрын
BROO thank You so much!!!!!!
@terrencelin5133
2 жыл бұрын
or you could just set the humanoid to have a hipheight of 2
@chunkyfunkymonkey
2 жыл бұрын
@@terrencelin5133 no, this doesnt work for r6.
@chunkyfunkymonkey
2 жыл бұрын
and if u have multiple sized r6 towers, you cant easily change that.
@nol12bloxYT
2 жыл бұрын
For anyone who has an R6 model for your tower ("Select the humanoid to check") and when you place the tower it has a floating bug, change the RigType from R6 to R15 in the humanoid.
@wuwapit8293
2 жыл бұрын
When i change the rig it just changes the arms legs and torso to brick what can i do to change that
@nol12bloxYT
2 жыл бұрын
@@wuwapit8293 maybe try using a different model that is R15 or maybe mess around with the hipheight.
@wuwapit8293
2 жыл бұрын
@@nol12bloxYT setting hipheight to 0 works but when im placing the tower it clips into the floor
@nol12bloxYT
2 жыл бұрын
@@wuwapit8293 I had the same problem, but when I changed the rigtype to R15 and set hipheight to 2, it seems to work fine to me.
@wuwapit8293
2 жыл бұрын
@@nol12bloxYT found a solution add the height of one of the legs: local y = result.Position.Y + towerToSpawn:FindFirstChild("Left Leg").Size.Y + (towerToSpawn.PrimaryPart.Size.Y / 2)
@The_Noooob
10 ай бұрын
Thank you GnomeCode! Your tutorials are the best!
@topcaseoh
10 ай бұрын
Okay so I am having some trouble with my placement system. When I click on the tower it works fine and when I place it its fine. But lets say someone clicks a tower, then they decide they want to place a different tower then they would just click a different tower in the loadout. But in my game when you try to do that it spawns in a placeholder tower making it difficult to place other towers. Does anyone have a fix for this?
@MohamedAmr-i8x
8 ай бұрын
i actually have a problem that it is says that setprimaryPartCframe is not a valid member of workspace
@tigertylan1133
7 ай бұрын
Capitalize the f
@safetysignfigure
3 ай бұрын
if you havent yet, make this change asap change the function that adds a placeholder tower to this gui.Spawn.Activated:Connect(function() if towerToSpawn then RemovePlaceholderTower() else AddPlaceholderTower("your tower here") end end)
@YourNormalRobloxian
17 күн бұрын
It just spawns a tower in before you even click the button
@safetysignfigure
15 күн бұрын
@@YourNormalRobloxian no it removes the placeholder if it already exists, pratically a cancel button
@rgby1367
2 жыл бұрын
Pretty impressive tutorial. I personally would have done few things slightly different, but it was interesting to see what you did. I have tried making a few tower defense games before, but I'm never too sure how I should make the towers attack the enemy that is closest to the end.
@AkaThemeParkTycoon2Addict
Жыл бұрын
Maybe try having attack teh unit that has existed the longest?
@Mini-se6cx
Жыл бұрын
@@AkaThemeParkTycoon2Addictslower enemies completely invalidates this
@rcen3493
Жыл бұрын
@@AkaThemeParkTycoon2Addict Problem with that is, is slow enemies spawn and fast enemies spawn too, the fast enemies wont be targeted.
@alexanderholmgaardlindholt4922
2 жыл бұрын
I like the tutorial, i don't follow it but it looks very good, and not too hard for beginners :) Good work GnomeCode!
@GnomeCode
2 жыл бұрын
That's great to hear, thank you!
@-Cloud-9-Nine-
Жыл бұрын
As a beginner myself, this tutorial is so helpful and educational!
@greenqz
Ай бұрын
im using r6 towers and its not letting me spawn it on the first step :(
@guxango8630
2 жыл бұрын
Can you make a model with all the towers so we can take your towers?
@angomango173
7 ай бұрын
he has already done this
@luxey0405
2 жыл бұрын
Im making a game with this tutorial but i have ran into a problem where i cant have accessories on my tower without anchoring the whole thing, is there a way to fix this or do i have to just not use animations?
@kartdrainer
2 жыл бұрын
have you tried simply unanchoring the accessories
@KMC_MrChicken
2 жыл бұрын
weld it
@wasdwar4egregsgsfdgrsdfgsreg
Жыл бұрын
if you want to make it so you can cancel the tower placement, go right under where you put the rotation part and put elseif input.KeyCode == Enum.KeyCode.Q then RemovePlaceholderTower() end you can replace the keycode with anything you want but I just put it as Q
@concealedVV
Жыл бұрын
on what line?
@R1S1SKA
11 ай бұрын
Thank you!
@captainmojo3771
9 ай бұрын
for anyone who is having trouble with this do this to make it work right. RemovePlaceholderTower() end ------------------------------------------------------------------------------------------------------------------ don't copt anything before this line this is just to show where to put it elseif input.KeyCode == Enum.KeyCode.R then rotation += 90 elseif input.KeyCode == Enum.KeyCode.Q then RemovePlaceholderTower() end end end)
@PipoPavan
2 жыл бұрын
17:14 if / 2 doesnt work . Try using + 1 :)
@user-fx3ux9uo1m
2 жыл бұрын
tysm
@oscmatis
Жыл бұрын
it still goes 1 stud up when clicked
@Fapbey
Жыл бұрын
What if I spawn a cowboy where he should be, I can't even choose where to put him!
@BryAstronaut
Жыл бұрын
12:06 gnome jumpscare
@galaxywithcaramel
Жыл бұрын
I'm a gnome!
@lilianaramirez8496
2 жыл бұрын
If anyone is using R6 then replace your Y position script, with local y =result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y + 1)
@banana_manpin
2 жыл бұрын
wdym at what
@banana_manpin
2 жыл бұрын
im using r6
@Bobbies1
Жыл бұрын
oh damn, this is a good tip
@Reis13official
Жыл бұрын
thank you!
@slurpybanana
Жыл бұрын
TYSM
@RaptorBoiYT
2 ай бұрын
Not sure why, but when I spawn a tower it places it in the air a bit. Does it have to do with the hip height or something?
@bornaurek2177
2 ай бұрын
your probably using r6 just use " local x = result.Position.X local y = result.Position.Y + TowerToSpawn["Left Leg"].Size.Y + (TowerToSpawn.PrimaryPart.Size.Y/2) local z = result.Position.Z"
@karleegaming8482
Жыл бұрын
Can someone help me? My tower is working perfectly fine until I place it into the "Towers" folder. Once I do that and spawn the tower it stops printing everything it is being told to do and doesn't damage the enemy.
@zek3was_here_
6 ай бұрын
I'm having a similar probl3m but it's the tower just won't spawn
@justaguythatpostsrobloxclips
4 ай бұрын
@@zek3was_here_ Yeah i am having the same problem
@tiredsofa
3 ай бұрын
is the towers folder in workspace or replicatedstorage
@karleegaming8482
3 ай бұрын
@@tiredsofa replicatedstorage
@karleegaming8482
3 ай бұрын
@@tiredsofa replicatedstorage
@hudaiscool
2 жыл бұрын
this help me alot! also I have a suggestion: a skin shop for towers, require money to spawn tower, a map teleporter [in lobby and then you select map in elevator/map select then teleported], gamemodes, gives buff tower.
@mouseinglasses
2 жыл бұрын
Tds player?
@sukiyaki4623
2 жыл бұрын
@@mouseinglasses nope literally just the basics of a roblox td game
@Bot-iv7io
Жыл бұрын
@@mouseinglasses tds doesnt let you select maps unless its in survival so it leans more towards critical tower defense
@laurarinas3838
2 ай бұрын
Removing the placeholder doesn’t work pls help
@zFrost
2 жыл бұрын
(Solved, note for future me to remember this comment if it happens again) When i press the spawn button my tower gets cloned in the place where i left it instead of following my mouse, any ideas why this isn't working? I've tried using a mesh part as my tower and a humanoid NPC as a tower and they both act the same, they work exactly like this: 7:17 My code is the same as the video except everything past fixing height offset Solution: I checked the video 3 times, and just now i realized what was wrong in the game controller script: local function AddPlaceholderTower(name) local towerExists = towers:FindFirstChild(name) if towerExists then local towerToSpawn = towerExists:Clone() towerToSpawn.Parent = workspace.Towers end end All you have to do it delete the "local" in the third towerToSpawn
@umm134
2 жыл бұрын
TYSM!
@cakecheese2895
Жыл бұрын
You are an angel
@Reis13official
Жыл бұрын
Holy Bro I love you thank you you just saved my life and like 35 hours of trying to find out the bug
@i_beez
Жыл бұрын
*I tried to fix 1 hour, THANKS*
@slurpybanana
Жыл бұрын
It still spawns it in the placeholder position and not where i clicked
@literallythatbaconyt5476
2 жыл бұрын
i need help: when i place another tower it just goes back to it's position when i put the tower in ReplicatedStorage and there is a random block (or torso of my tower) in the left side, so GnomeCode help me with this problem when you see this. And also my tower’s lower body is stuck on floor when your preparing to place my tower. And how to make a tower and how to give your tower a weapon.
@thecastorzs7373
2 жыл бұрын
Same and I don't know how to fix either
@zgray3807
2 жыл бұрын
Same for the 1st half
@BaconLettuceYT
4 ай бұрын
@@zgray3807 its anchored or smth
@Karma3064
2 ай бұрын
I have this problem too
@bozominuselevation
Жыл бұрын
if your character doesn't have a hipheight, click the model and check it's size, and then make the hip height double the size of your model. it should work if you have a normal r6 rig.
@lukiValent
2 жыл бұрын
If you want enemies ignore timeout, then you can use this "fix" timeout = when the humanoid dont reach the target in 8 seconds, it will go to the next point immediately. function enemy.MoveNPC(point, mob) local rootpart = mob:WaitForChild("HumanoidRootPart") local humanoid = mob:WaitForChild("Humanoid") repeat wait() humanoid:MoveTo(Point) until (rootpart.Position - Vector3.new(Point.X, HRP.Position.Y, Point.Z) ).magnitude
@lukiValent
2 жыл бұрын
ignore the #paths lmao
@connorblox2244
2 жыл бұрын
or just add more waypoints
@mazenez4222
2 жыл бұрын
HEY luki my script isnt working can u tell me whats wrong pleasee local PhysicsService = game:GetService("PhysicsService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local events = ReplicatedStorage:WaitForChild("Events") local towers = ReplicatedStorage:WaitForChild("Towers") local spawnTowerEvent = events:WaitForChild("SpawnTower") local camera = workspace.CurrentCamera local gui = script.Parent local towerToSpawn = nil local canPlace = false local function MouseRayCast(blacklist) local mousePosition = UserInputService:GetMouseLocation() local mouseRay = camera:ViewportPointToRay(mousePosition.X, mousePosition.Y) local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.FilterDescendantsInstances = blacklist local raycastResult = workspace:Raycast(mouseRay.Origin, mouseRay.Direction * 1000, raycastParams) return raycastResult end local function RemovePlaceholderTower() if towerToSpawn then towerToSpawn:Destroy() towerToSpawn = nil end end local function AddPlaceholderTower(name) local towerExists = towers:FindFirstChild(name) if towerExists then RemovePlaceholderTower() towerToSpawn = towerExists:Clone() for i, object in ipairs(towerToSpawn:GetDescendants()) do if object:IsA("BasePart") then PhysicsService:SetPartCollisionGroup(object, "Tower") object.Material = Enum.Material.ForceField end end end end local function ColorPlaceholderTower(color) for i, object in ipairs(towerToSpawn:GetDescendants()) do if object:IsA("BasePart") then object.Color = color end end end gui.Spawn.Activated:Connect(function() AddPlaceholderTower("Slinger") end) UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if towerToSpawn then if input.UserInputType == Enum.UserInputType.MouseButton1 then if canPlace then spawnTowerEvent:FireServer(towerToSpawn.Name, towerToSpawn.PrimaryPart.CFrame) RemovePlaceholderTower() end end end end) RunService.RenderStepped:Connect(function() if towerToSpawn then local result = MouseRayCast({towerToSpawn}) if result and result.Instance then if result.Instance.Parent.Name == "TowerArea" then canPlace = true ColorPlaceholderTower(Color3.new(0,1,0)) else canPlace = false ColorPlaceholderTower(Color3.new(1,0,0)) end local x = result.Position.X local y = result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y / 2) local z = result.Position.Z local cframe = CFrame.new(x,y,z) towerToSpawn:SetPrimaryPartCFrame(cframe) end end end)
@lukiValent
2 жыл бұрын
@@mazenez4222 does the script gives any error?
@typicalaverage
2 жыл бұрын
@@lukiValent yo Luki, i tried using the code, BUT it doesnt seem to work in the mob move part, is there a fix for that? (It gives an error that mobmove isnt a parent of "Basic" (custom) zombie)
@Wazzalish
2 жыл бұрын
To get damage to work on a tower for now you need to change in the testing tower script (If your have your script in the tower) change workspace.TowerName.HumanoidRootPart to workspace.Tower.TowerName.HumanoidRootPart then damage should work!
@bobkerman8930
2 жыл бұрын
"If u have ur script on ur tower" wait where i put it?
@jjmyclark7354
Жыл бұрын
I don’t understand
@KirillCompere
Жыл бұрын
gnomecode! i was typing script and i click start and i click the gui and tower is not moving just stop moving and i click too many times hes duplicating random numbers
@RymanPotato
2 жыл бұрын
Please make a way for you to upgrade your towers, the base can lose health, and be able to place multiple towers not just slinger.
@jmbutchkoy4950
2 жыл бұрын
Dude the series isn't even finished be patient
@animebeastmasterpro67
2 жыл бұрын
@@jmbutchkoy4950 he was asking for gnomecode to create those things in a new video, chill
@jmbutchkoy4950
2 жыл бұрын
@@animebeastmasterpro67 Why are you telling me to chill when I wasn't even upset at my other comment above?
@animebeastmasterpro67
2 жыл бұрын
@@jmbutchkoy4950 my brain just melted reading those last few words
@jmbutchkoy4950
2 жыл бұрын
@@animebeastmasterpro67 shoot.. should've worded it differently lmao
@HurelyDev
2 жыл бұрын
Good Tip: If You Want Your Towers To Walk Towards A Enemy, Use This Inside The Script: local tower = script.Parent.Parent local mobs = workspace.Mobs local function FindNearestTarget() local maxDistance = 100 local nearestTarget = nil for i, target in ipairs(mobs:GetChildren()) do local distance = (target.HumanoidRootPart.Position - tower.HumanoidRootPart.Position).Magnitude if distance < maxDistance then nearestTarget = target maxDistance = distance end end return nearestTarget end function moveToTarget() local Target = FindNearestTarget() if Target then script.Parent.Parent.Humanoid:MoveTo(Target.HumanoidRootPart.Position) script.Parent.Parent.Humanoid.MoveToFinished:Wait() if Target.Humanoid then Target.Humanoid.Health -= 100 wait(1) script.Parent.Parent.Humanoid.Health = 0 else script.Parent.Parent.Humanoid.Health = 0 warn("Humanoid Doesnt Exist") end else script.Parent.Parent.Humanoid.Health = 0 end end script.Parent.Parent.Humanoid.Died:Connect(function() warn(2) script.Parent.Parent:Destroy() end) while true do task.wait(0.1) moveToTarget() end
@devdeepy5665
2 жыл бұрын
hey it seems like you good at script but can you help me something? when i place 1st tower, you cannot walk to through tower but when i place another tower, you can walk i think physic service having delay so do you have a script to fix it?
@HurelyDev
2 жыл бұрын
@@devdeepy5665 I'm also having a physics service bug where I cant walk through them even when I wait
@devdeepy5665
2 жыл бұрын
@@HurelyDev fixed the problem but OnPlayerAdded is glicthy
@TheWatcherYT
2 жыл бұрын
Use a "player.CharacterAppearanceLoaded", it works for me since the character being added takes a while so this waits until it loads.
@joshyh4vidz
10 ай бұрын
my tower isnt spawning and there is no errors please help
@8BitVRGT
13 күн бұрын
At 24:07 does he enter the duplicated script or is the duplicated script have everything the og one has?
@allusions5044
2 жыл бұрын
15:09 timetsmap 28:38
@bobtroll7838
Жыл бұрын
what about it
@jinxed-truly
Жыл бұрын
@@bobtroll7838 probably left it there so he cu=ould get back to where he was
@Mvp-903
2 ай бұрын
the tower i made isnt spawning when i click the button
@Melones299
3 ай бұрын
thank you so much this series its really goodddddd
@Jaguar-gg7br
2 ай бұрын
Guys, I have a problem. I'm using a R15 character with details for the scenery, everything seems to be fine, but when I press the spawn button, the details decrease, and the tower itself is placed in the starting place. Help me please(((
@yasboy8268
4 ай бұрын
This rly helped me i was stuck for 1 hour but it's now ok Thanks man!
@user-sz3bo3el8v
3 ай бұрын
please help me, he appears and follows the cursor, but he does not put it on and lights up red all the time, what should I do?
@timaplay123
Жыл бұрын
Hi,i have a problem, when me trying to place towers tower dont recognize anything in towerarea folder tower just red and i cant place it, i checked script and theres no typo what should i do? thank you
@jackaa755
2 күн бұрын
we validate if the user can place the tower on the client but wouldn't we want to validate that on the server aswell, incase there are exploiters?
@roccobon
3 ай бұрын
for those that have an error when clicking to place the towers, in the towers module script change server storage to replicated storage
@doctormogana
2 ай бұрын
when I type Blacklist it says its deprecated. what should i do
@ThidDrutsburg
2 ай бұрын
use exclude instead.
@Famousbycommenting-bd4pf
2 ай бұрын
Thx
@Munoastro
2 ай бұрын
For anyone whos having issues with the collisions, change PhysicsService:SetPartCollisionGroup(object, "Tower") to object.CollisionGroup = "Tower"
@pait.gamers3073
Жыл бұрын
i was at the 8 minutes mark then i got engrossed in the potential masterpiece i could make and started dancing and bobbinb my head
@thegamerx1256
8 ай бұрын
why is the placeholder tower still there when i spawn the tower
@KingOrangeOfficial
11 ай бұрын
My tower won’t spawn no error no nothing except for the print :( 😢 pls help
@akiprox7
Жыл бұрын
Best series in the world, ty!
@pizzawithananas
8 ай бұрын
my tower would not stick to my cursor and it would be very hard for me to move it around as it keeps falling off, how do i make it so that it sticks to my mouse pointer?
@crypto-key-yt
2 ай бұрын
Exuse me, what should I do if the tower appears in the same place?😅😅
@NotAnOrdinaryBaconLife-h2z
14 күн бұрын
idk either its happening to me too
@Hudson-ft8go
5 ай бұрын
Thank you so much me and my friends were making a tower defense game and we gave up before we made waves but now were doing where i code and he models stuff
@Boozer22
3 ай бұрын
Please can someone help me? Attempt to connect failed: Passed value is not a function - Studio idk what to do
@KonnerRb
2 ай бұрын
probably because you spelt a function wrong, or you accidentally deleted a line of code that defined it. Check his code and compare it to yours.
@Chip95
Жыл бұрын
How do you change the collision group code to the new code as the code in this video is kind of outdated
@HHN-fanatic
Жыл бұрын
Same
@jinxed-truly
10 ай бұрын
Just change the "PhysicsService:SetPartCollisionGroup(object, "Tower") to object.CollisionGroup = "Tower"
@TheRealMatt777
Ай бұрын
how to add weapon to it like the slingshot
@nicolaielias1777
8 ай бұрын
Help me pls. 26:23 after i put (newTower.HumanoidRootPart.CFrame = cframe) in it didnt work. Instead of placing the slingers position where the ghost slingers position were it just placed it somewhere random. I dont know why it did this. Can someone help me?
@vysmatejtulen5588
Жыл бұрын
I have a problem my towers are opposite direction than placeholder
Пікірлер: 3,2 М.