I have put a Stringvalue in the player, called : QuestProgress The String's base value is: None I want so that when a player touches a part the string value changes, but struggled to do it on my own, probably because i'm acting like it is a IntValue. The script in the part is:
script.Parent.Touched:connect(function(player) print (player.Parent.Name) --This would print the name of the person who touched the brick local Player_name = player.Parent.Name local Quest=script.Parent Quest:remove() -- Haven't tested the remove part, because the script wasn't working without it, anyway. game.Players[Player_name].CurrentQuest.Value=game.Players[Player_name].CurrentQuest.Value.Finding Apples -- I think this is the problem end)
I have tried this for the last line too:
game.Players[Player_name].CurrentQuest.Value=game.Players[Player_name].CurrentQuest.Value."Finding Apples"
To no prevail. Thanks.
Try this line in place of 6 --
game.Players:GetPlayerFromCharacter(player).CurrentQuest.Value = "Apples"
Assuming that's what you're attempting to do, it should work.
This is because in a touched function, it returns the Character
player (game.Workspace), not the game.Players player. By using Players:GetPlayerFromCharacter(player)
, it'll then reformat the game.Workspace character into the game.Players player.
And, when setting string values (assuming you were trying to just do this), all you need is the text you want to set it to in "".
(Excuse anything that might seem obvious in explanation -- I'd rather over explain than under explain)
EDIT After examining the issue more thoroughly, it seems that the way you're setting your string is the true issue.