#Function If statement might not work

1 messages · Page 1 of 1 (latest)

tardy light
#

Hi guys im doing a script for the player that will turn him into a ball after touching a part, but one of the functions Inside a local script that works after an event is received doesnt work, and I really want to fix this because I have been working on this game over a month now, so any help would be nice tbh!

polar raven
#

also

tardy light
polar raven
#

instead of using force = force + blah

#

u can use

#

force += blah balh

#

u wont have to add the extra force

#

and

#

dont add .Unit

#

i believe lookvector and rightvector are units already

tardy light
#

okay but one question

#

when i put a print insid the "if" statement it doesnt work

polar raven
#

that means the if statement is false

#

have u checked the output?

tardy light
#

yes millions of times

#

and i put interruptions but nothing shows up i think

#

It means that it doesnt show the error, or im too dumb to notice the error

polar raven
#

maybe cuz the first line is true

#

so the function doesnt run

tardy light
#

the "isball" value is false, and the "currrentball" value is "Nil"

polar raven
#

what is keysPressed

#

like

#

a tabl

#

table

#

value

#

etc

tardy light
#

it's a table

#

that haves WASD, not the keys, but the letters

polar raven
#

and whats in the table

tardy light
#

they are all set to false

polar raven
#

then

#

force will always be set to 0

tardy light
#

⁨⁨```lua
local keysPressed = {
W = false,
S = false,
A = false,
D = false
}

--like that

polar raven
#

ye ye

#

see

#

that means force will always be Vector3.new(0, 0, 0)

#

which mean

#

means

#

no force will be added

tardy light
#

yeah..

polar raven
#

if u want

#

i can check this in studio

#

so

#

i can make it so

#

it will actually detect whether the keys will be pressed

tardy light
#

I dont know how to pass you the whole script, as it's too big

naive vineBOT
#

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

polar raven
#

no u can just invite me to studio

tardy light
#

ohhh ok

polar raven
#

youll have to add me on roblox first

#

my user is my discord user

tardy light
#

could you wait half an hour or no? Cuz i gotta do somethin' real quick

polar raven
#

sure