local admins = {"moo1210","Player","Player1"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(message, player) if message == ":outscore" and tableContains(admins, player.Name) then
So am trying to make it so if I did :outscore 5 it would change a number value to 5 it is under ServerStorage and the number value is called Outscore. Please help me, Thanks! If anything is wrong in this script also help me with that. Post the full code for this command.
There is nothing clearly incorrect and the command is simple. All that you need to do is get the object with the value and change the value inside it. The command would be as follows:
game.ServerStorage.Outscore.Value = 5
Then to further add to this you could instead add to gain value:
game.ServerStorage.Outscore.Value = game.ServerStorage.Outscore.Value + 5
If you are looking for adding or making the value the number said, it gets more complex. If you want it to be the number that you chatted, that might be pretty hard. With my version, the command would add 5. This is what I would do:
local admins = {"moo1210","Player","Player1"} function tableContains(t, value) for _, v in pairs(t) do if v == value then return true end end return false end function onChatted(message, player) if message == ":outscore" and tableContains(admins, player.Name) then game.ServerStorage.Outscore.Value = game.ServerStorage.Outscore.Value + 5