#TextBox.Text problem

71 messages · Page 1 of 1 (latest)

inner ivy
#

It has to be a local script as it's part of the local players screen

languid falcon
#

but in this script i also change a player leader board

frozen barnBOT
#

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

inner ivy
#

use a remote event in the local script and send the event to the server. On the server event, change the leaderstats

languid falcon
#

how did this?

inner ivy
#

in replicated storage add a remote event

#

let me know when you've done this

languid falcon
inner ivy
#

Name it something like updateleaderstats

languid falcon
#

ok

inner ivy
#

when do u actaully want the leaderboard to be updated

#

Once they have finished typing in it?

languid falcon
#

then when I press the button in this interface

inner ivy
#

So when you press the text button, the text currently in the text box gets taken and displayed on the leaderboard?

frozen barnBOT
#

studio** You are now Level 5! **studio

languid falcon
#

something like this

inner ivy
#

want me to write the script for you or explain it to you?

languid falcon
#

and create a new server script with update leadestats?

inner ivy
#

yup

#

very good

#

let me know if you need any help with it

languid falcon
#

ok

#

can i enter an argument in FireServer?

inner ivy
#

Yes you can just by adding it like FireServer(argumentName)

languid falcon
#

and how i can get it in server script?

inner ivy
#

use updateleaderstats.OnServerEvent:Connect(function (arguments) code here)

#

perfect

languid falcon
#

ok

inner ivy
#

first argument is always the player that called the event

languid falcon
#

and can i get models from serverstorage in localscript?

inner ivy
#

No i don't think that's possible

#

use replicated storage instead

languid falcon
#

ok

#

i need to enter two arguments

#

value is integer number

#

but if i try do leaderstats.Money.Value -= value in server script, he outputs " ServerScriptService.UpdateLeaderboard:4: attempt to perform arithmetic (sub) on number and Instance"

#

with just number this works

inner ivy
#

did you fix it?

languid falcon
#

no

inner ivy
#

send both pieces of code and I will have a look

#

client and server

#

I see the problem

#

when you fire server on the client side, i don't think you need to include the player argument

#

just value

#

the player is automatically sent so you don't need to include it

#

so just edit the client side one to change it to FireServer(value)

languid falcon
#

i try it

#

ok i works

#

so one more question

inner ivy
#

of course?

languid falcon
#

i have a meshpart with script

#

if i touch this part - i get 10 wood

#

but when i relocate meshpawrt from ServerStorage to Replicate Storage - the script in this part stopped working

#

but original part anyway works normaly

inner ivy
#

scripts can't be run in replicated storage if that's your problem?

languid falcon
#

no

#

i clone a mesh part

#

he include script

#

and when i clone it in workspace a script stopped working

inner ivy
#

sorry i don't understand what you mean

languid falcon
#

i have a part

#

this part includes a script

#

if i touch this part, script add in playerstats value

#

but when i relocate a part

#

script stopped working

#

and if i push the button in user interface i clone this part in workspace

#

and in this cloned part script does not working

#

thank you very much

#

❤️

#

@inner ivy