Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I change a StringValue whilst in-game and through the F9 Console?

Asked by 2 years ago
Edited 2 years ago

I want to give other players pets and by doing so I do the command game.Players.OtherPlayer.Pets.PetName.Value = owned ^ this doesnt work though. I just get this error: -- console:1: invalid argument #3 (string expected, got nil) the pets are managed by stringvalues in a pets folder in the player, if a stringvalue(so a pet)'s value is set to "owned" it will put the pet in your inventory. and if the value is unowned, it will take it out of your inventory and or you just wont have the pet

0
Since it's a string value put it in quotation mark. E.g. game.Players.MarkedTomato.Pets.PetName.Value = "Something" MarkedTomato 810 — 2y
0
Did my answer help? If so please upvote and mark as answered! bbissell 346 — 2y

1 answer

Log in to vote
1
Answered by
bbissell 346 Moderation Voter
2 years ago

Strings have to be put in quotation marks. Try this:

game.Players.OtherPlayer.Pets.PetName.Value = "owned"
Ad

Answer this question