How do i make a tower like in tower battles

Hello,
This is my first post in devforum but i wanted to ask that i am making a game which is similar (a lot) to tower battles/tower defense simulator i want to know what scripts are needed to make it shoot the zombies and face them one by one i am not asking entire scripts i just want to know how do i that also i want to know how to make a placement system like how i can place towers

hope you reply, fellow reader

9 Likes

Well this is kind of a weird post but lets try first off… Welcome to dev forum!

I’ve never really played tower battles but I know they have NPCs. For the NPCs you can use path finding and moveto

Here’s a video I found made by DevKing and it covers that basic stuff needed

For the guns I would suggest using something like raycast. But if you want to be more simpler use hit dection/scan as that can save time.

Raycast Gun

Hitscan Gun

Hope this helps!

6 Likes

Welcome to DevForum!

You can use CFrames to let the turrets/guns face the zombies.
Below is an example script:

local Part1 = script.Parent
local Part2 = game.Workspace.Part2
Part1.CFrame = CFrame.new(Part1.Position, Part2.Position)

For guns you can use Raycasting, there are many online resources to help you.
Tutorial from TheDevKing

Before you make a game, be sure to learn how FilteringEnabled works as it protects your game from exploiters.
I suggest you to learn from the basics by watching tutorials or looking at the Developer Hub. You should always start off making some easy games (simulators/tycoons). A tower battles game might be too hard for you!

Good Luck~

1 Like

i do know its very hard but like simulators are boring!

1 Like

i am very new so what is cframe and how does it work? and also i wanna know how to make a upgrade button work like i click it its damage increases looks better and all that stuff

CFrames are similar to Vector3. But Vector3 is about position while CFrames are position and rotation

There is a guide explaining CFrames by TheDevKing:

1 Like

k thx ill try its quite hard but ill try this is my first project like first big one

although i cant put any as soltuion becuase that ll be just unfair

Its about not being fair or unfair, solutions mark as an answer to your question, so if someone gets it right, please mark that answer as a solution so that other people browsing this thread in need of the same questions as you will able to view the solution! :grin:

2 Likes

on how to make an upgrade button; make the damage count to a variable and if you press a button then the variable increases by ___

4 Likes