#TDS GAME HELP!!!

44 messages · Page 1 of 1 (latest)

rose burrow
#

Show me script

south salmon
#

its like 7 scripts

#

but not

#

ill send it

#

wait whats the format

#

to send a script

#

nm

#

its kinda big

#

thats the modual script

#

and then the client script im sending rn

#

I think smthn wrong with this one line

#
function tower.CheckSpawn(player, name, upgradeName)
    local towerExists  = findModel(name, upgradeName)
    if towerExists then
        print("towerExists")
        print(towerExists)
        if player.Gold.Value >= towerExists.Config.PlacementCost.Value then
            if player.PlacedTowers.Value < maxTowers then
                return true
            else
                return 2
            end
        else
            return 3
        end
    end
end
#

the if player.Gold.Value >= towerExists.COnfig.PlacementCost.Value then

#

cause thats where its erroring, but it could just be im sending the wrong value, but I checked with printing and debug and its sending the correct value...

#

ServerScriptService.Main.tower:126: attempt to index nil with 'PlacementCost'

#

error im getting

#

no clue why

#

it seems to error when I click, ima try and fix that area in the client script

#

I think because of the fact that client cant eddit server and when sending a value, I sent the wrong one?

steel riverBOT
#

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

south salmon
#

also if ur still here, thx for trying to help

south salmon
jagged cliff
#

so

#

basically

#

COnfig is nil

#

or Config

#

@south salmon

#

can you show findModel()?

south salmon
#

i rage quit

#

lol

#

ima re-do it all

south salmon
jagged cliff
#

bro

#

dont rage quit

#

ur code is fine

south salmon
#

lol

#

im going to re do it

#

ill send scripts if u want them

south salmon
#

but it sets it to smthn

#

and the only other way it changes it to nil is AFTER upgrading