#How do I prevent the Card Level from duping when the player respawns?

33 messages · Page 1 of 1 (latest)

gusty gyro
#

@gusty gyro Because it's inside of a CharacterAdded event, it plays every time they respawn. You could run a check to make sure CardLevel doesn't exist before you create a new value.

gusty gyro
#

i already tried

#

Same way you made the check to see if there was a card towards the center of your code with the massive amount of if-statements

#

only you add the not operator so it only fires when there isn't one

gusty gyro
#

So like this?

hybrid ermineBOT
#

studio** You are now Level 4! **studio

gusty gyro
#

@gusty gyro

#

yes its fixed

#

ty

#

No problem man. As long as you keep remembering stuff like this, it'll get easier.

#

Oh by the way

#

i started to organize my scripts

#

is that how i am meant

#

to organize my scripts?

#

I don't usually follow the standard and my code is like spaghetti, but that looks good to me from first glance

#

is it true

#

that if you delete spaces

#

in your code

#

like random lines with nothing in them

#

that it helps with lag

#

That would depend on how roblox handles things

#

btw

#

do you know

#

I've heard shortening variable names can also help with lag

#

how i would make this

#

tell you how many more days

#

you got?

#
game.Players.PlayerAdded:Connect(function(plr)
    if plr.AccountAge > 30 then
    else
        plr:Kick("Your account doesn't meet age requirements, please come back in a couple of days!")
    end
end)
#

Instead of just saying please come back in a couple of days

#

Look into the tick() function. There's a formula you can use to get it to go from seconds since 1970 to the current date.

#

Also, I highly recommend you look into tables, dictionaries, RunService, and for i,v in pairs. They can help you organize those cards a bit better, I believe.

hybrid ermineBOT
#

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