Hello Fellow Devs, I am currently trying to script a Gui that will change a players Cash/Points value.
I just don’t know how to approach this and need some help. To give more detail, you are going to put the player’s name into one text box, and the amount of points in the other. When you are done you press the give button and the player name and amount of points will go to a IntValue and StringValue, and then it will give the chosen player the desired amount of points. Here is an image of the gui, it is only visible to the admins of the game which is why I chose to do it like this Here is an image of the IntValue and the StringValue Please if you have any advice any help is appreciated, thanks for reading and have a good day!
Ok, you could use leaderstats for this? You want me to write a quick script for this?
I have an existing leaderstat which is just “Points”
and like I said I’m just trying to add to the value from the gui.
Where is this gui stored? (30 chars) I just wanna know this so that way I can actually get a perfect script for you.
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Points.Value = script.Parent.Parent.AmountOfPoints.Text
game.Players[script.Parent.Parent.PlayerName.Text].leaderstats.Points += Points.Value
end)
It is in StarterGui, along with the IntValues, and the open/close gui scripts
Why is a players name an intvalue? Or am I not understanding
NOTE: DONT USE A LOCALSCRIPT TO GIVE THE POINTS, INSTEAD USE A SCRIPT.
Once the button has been pushed use a server script to use the code that I gave you.
Also the players name has to be in a stringvalue.
Because when you enter the name in the gui the I want the name entered to be in an IntValue
Thats impossible. A player name is not a number.
Oops I meant StringValue my bad
I suggest sticking to string values. Much more simple. Oh
V Since that’s what you meant then nvm lol But you can use Client to Client Remote Event , so it’s not exploitable more or less
I don’t understand why the player name needs to be in a string value, you can just use the Text property in TextBox Also where is this script gonna be placed?
Yea I didn’t see realize that, thanks. The script is going to be in the give button
use this sdajdhjlasljkdjkl;asdljk (30 chars)
Thanks, but there is an issue, I get a error message in OutPut that says " is not a valid member of Players." so the script doesn’t work
umm, did you put anything in the textbox
Yes, I put my username, I am trying to debug it now
1/2 Are you sure it should be a Script not LocalScript 2/2 Here is a video of the issue
Dude, using a localscript wouldn’t update the thing.