#TD game towers configuration issue

1 messages · Page 1 of 1 (latest)

austere kiln
#

in a TD game in roblox, i have two different towers in a towers folder in replicated storage, each one has a configurations folder named config, which it has the intvalues "Damage", "Range" and "Cooldown", however, the "Tower" local script in server script service makes all towers have the same properties (damage, cooldown, etc) can someone help fix it? (each config folder is indiviual and is inside each tower)

(first image line 1-44)
(second image 44-end)

rancid mist
#

Local scripts are for client behaviour and thus don’t run on the server (including ServerScriptService)

#

What are you intending to do with the config values?

austere kiln
#

im intending to give different towers different properties

#

like firerate (cooldown)

#

damage

#

and range

#

the local script tower is inside a normal "main" script in the server script service

rancid mist
#

Mk and what’s the actual issue? You have different config folders in each tower right?

#

I’m not quite sure I understood your issue properly so forgive me for asking

austere kiln
rancid mist
austere kiln
#

what im saying is, for example, each tower has different range value but the script still gives all towers the same range (and dmg)

tropic capeBOT
#

studio** You are now Level 1! **studio

rancid mist
#

Both client?

austere kiln
#

yea

rancid mist
#

And where are they not changing? Server?

austere kiln
#

exactly

rancid mist
#

If a client manipulates a piece of information on their own side, the server cannot see it unless replicated

#

Are you changing tower values because of upgrades etc?

austere kiln
#

so i must change it in server side?

austere kiln
#

just the base properties

rancid mist
austere kiln
#

ill check if it works

rancid mist
#

And for upgrades you can use remote events to send information to the server

austere kiln
#

doesnt seem to work...

#

this is the range of one of them

#

and the range of the other

#

but in game they attack from the same distance

#

(same with damage and cooldown)

rancid mist
#

Print the values that you receive from the config values

austere kiln
#

k

rancid mist
#

E.g when using TakeDamage print the value

#

And for range etc

austere kiln
#

where should i put it? im kinda using a tutorial for this stuff

rancid mist
#

Just before target.Humanoid-TakeDamage

#

And the start of FindNearestTarget

austere kiln
rancid mist
#

Aye

austere kiln
#

nothing in input

#

weird

rancid mist
#

Try for the range too

austere kiln
#

still nothing

#

i have a feeling the solution is gonna be simple, and im gonna feel dum

rancid mist
#

Put a print at the start of .Attack

tropic capeBOT
#

studio** You are now Level 10! **studio

rancid mist
#

And see if it’s even called

#

And one in .Spawn

#

Before you call coroutine.wrap

#

Just print anything and see if it shows

austere kiln
#

nothing, i guess its not called

rancid mist
#

Probably ur issue then

#

Where are you calling .Spawn?

#

Local script in server script service still?

#

Change it to a server script

austere kiln
tropic capeBOT
#

studio** You are now Level 2! **studio

rancid mist
#

1m getting off my bus

#

Scrshot Main script

#

Where you use the Tower module

austere kiln
#

1-53 and 53-end

rancid mist
#

Uh

#

I dont think ur using the Tower module?

#

Only mobs atm

austere kiln
#

i may have it in gamecontroller script, hold on

rancid mist
#

Does the tutorial show towers working?

austere kiln
#

(gamecontroller script ahs some towers stuff)
1-52 and 52-103 and 103- end

#

they do work

rancid mist
#

I see the issue

austere kiln
#

oh?

rancid mist
#

1s opening my door

austere kiln
#

oh ok

rancid mist
#

Ok so

#

Line 50

#

Ur not actually using the Tower module, u have repeated code in a different script for placeholding

#

Idk if u followed the tutorial properly or not

#

So ur missing the attack call

austere kiln
#

so what should i put to fix it?

rancid mist
#

Ok so

#

First at the top where u define local variables

#

You need to reference the Tower module by using require(game.LocationOfTowerModule)

#

Oh wait

#

Is game controller client sided?

austere kiln
#

hold on im checking

rancid mist
#

I think u should go over the tutorial again

austere kiln
#

script here, i think it is client sided

rancid mist
#

Im not sure why you’d have a Tower module but not be using it and instead using placeholder tolders

austere kiln
rancid mist
#

💀

#

Why are towers being spawned client sided

#

Very good question

austere kiln
#

can i send a small vid of how it works?

rancid mist
#

Send the tutorial and I’ll see if it’s shambolic or if you missed smthn

austere kiln
#

the tutorial are like +15 vids

#

i can send the one where the bug appeared

#

We add more more defensive tower units to the game, each with their own damage, cooldown, and range values. Also, a fancy new UI to go along with it.

Paint.NET Plugin ►
https://forums.getpaint.net/topic/12991-chroma-key-green/

WEBSITE ► https://gnome.codes/tutorials/tower-defense
DISCORD ► https://discord.gg/utqq7zM
TWITTER ►https://tw...

▶ Play video
rancid mist
#

Where are you up to

austere kiln
#

i was following it, i realized it wasnt working at 19:50

rancid mist
#

MK 1S

#

mk 1s

#

just got on pc

austere kiln
#

some game controller stuff happen earlier tho

#

k

rancid mist
#

ok i skimmed the tutorial

austere kiln
#

found something weird?

rancid mist
#

tutorial seems like just everything you've typed

#

go in to Main

#

in serverscriptservice

austere kiln
#

k

rancid mist
#

i think you missed the event implementation for spawning a tower

#

1s

#

u already sent main

austere kiln
#

yea

rancid mist
#

ok yeah

tropic capeBOT
#

studio** You are now Level 3! **studio

rancid mist
#

u misserd the

#

spawnTowerEvent implementation

austere kiln
#

can you screenshot the line i missed on vid?

rancid mist
#

1s

austere kiln
#

k

rancid mist
#

ok

#

Building off the back of our raycasting video, we can finish the tower placement system. This one is a biggie!

WEBSITE ► https://gnome.codes/tutorials/tower-defense
DISCORD ► https://discord.gg/utqq7zM
TWITTER ►@gnomecodeRBLX

TIMESTAMPS►
0:00 Intro
0:35 Creating GUI
3:34 Creating Placeholder Tower
7:45 Positioning Towers
11:55 Raycast...

▶ Play video
#

you're missing out some code from your Tower module

austere kiln
#

uh?

rancid mist
#

i timestamped it

austere kiln
#

in main?

rancid mist
#

so if you click it it'll go to where u need

rancid mist
#

if it doesnt take u to it

austere kiln
#

k ill check

#

ty if it works

rancid mist
#

if you need, rewatch the Placing Towers section

#

i think u may of skipped over the event implementation

#

that's ur issue

rancid mist
#

ping me if not

austere kiln
#

alr

austere kiln
rancid mist
#

huh

#

ye uhm if ur missing even more stuff i'd recommend skimming through previous videos to see if you've missed anything

austere kiln
#

k, ill check again

#

ty for the guide btw