Hello, I need help with code ui scripting
I coudn’t find the script that we put the name for code I mean I could find the the place to put the name of the code for code script.
So the first picture is located inside Code UI called Manager and the second picture is located in serverstorage called PlayerData.
I put the code in the second picture but it didn’t work it keep on saying code not found.
Since you aren’t receiving the remote function, that is the reason res == nil.
You have to create a script that receives the remote function and check from the PlayerData if the code is valid, if it is not return nil or if the already used the code return false
I don’t have a script to use, but I can give you an example on how to make one:
Create a script in serverscriptservice and call it codeCallback
Make a function in your player data script that gets the value of codes
In the codeCallback script receive the remote function that you gui script sends
Check from the PlayerData if the code is valid, if it is not return nil, if the already used the code return false, or if the code is valid return true
Remember that UseCode has to be a remote function not a remote event
This would be the basic gist of how to make what you desire
Also, the remotefunction you defined is wrong, it is replicatedstorage.Function.UseCode
You have to create a function in your playerData script to get codes, also playerData script has to be a module. If it isn’t a module you will transfer all code in codeCallback script to playerData script.