#Remote event value trouble

1 messages · Page 1 of 1 (latest)

silk zenith
#

Im sending a value on a remote event and on the client its ten but when it reaches the server its nil, does anyone know why?

zinc tendon
#

Show me the error

silk zenith
zinc tendon
#

What's it trying to do

silk zenith
#

im just having trouble recieving a value from a remote event

zinc tendon
#

Is it for money?

silk zenith
# zinc tendon What's it trying to do

It gets the text from the username text box, and the Amount text box, converts the amount text into a number value and sends it from the client to server using a remote event

silk zenith
#

but the amount is nil

zinc tendon
#

If the amount is nil you messed up part of the code

silk zenith
silk zenith
amber sky
#

youre sending 2 data's to server

#

plr.Text and

#

exacly]

silk zenith
#

plr.Text works

amber sky
#

plr.Text is nil

silk zenith
#

print(a) prints plr.Text

amber sky
#

plr.Text is b

U printing b on server but nv.Value on client

amber sky
#

print a prints player

#

first argument to on server event is player

#

followed by arguments

silk zenith
#

yes

amber sky
#

u sending 2 arguments

#

so on server recieves

#

player

#

plr.Text

#

nv.Value

#

u printing b which is 2nd argument

#

so plr.Text

#

which is nil

silk zenith
#

plr.Text is meant to be the player

amber sky
#

thats not how it works

#

u dont put player when u fire server

silk zenith
#

ohh

amber sky
#

it auto fills out

silk zenith
#

i get

amber sky
#

first argument is ALWAYS a player

#

on server event

silk zenith
#

right

#

lemme try sm

amber sky
#

so in your case, a - player, b - plr.Text

viscid panther
#

first of all the NumberValue should be handled on the server, AmountValue is not even replicated to the server cuz you're creating it locally

silk zenith
#

so would i do something like this

amber sky
#

stop

#

firing

silk zenith
#

pretend that says amount.Text

amber sky
#

server

#

with player

#

if u do

#

FireServer(arg1,arg2)

#

server will recieve

#

player,arg1,arg2

#

stop sending the player to server ;/

silk zenith
#

ahh

#

so sum like this?

#

plr.Text is not the player but the player that the amount value is gonna change in the future

amber sky
#

that would work ye

#

but its still bad practise

#

u should never trust client