Let’s jump to the issue:
I put a local script to test something. It would put the value of a StringValue to either “win” or “lose”, but neither show up! (Yes, I checked spelling, it is correct.)
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.WinLose.Value = "win" or "lose"
end)
Did you make sure that the string value WinLose is not nil? If it is that is your problem. Also I am unsure that it will randomly pick win or lose. With ‘or’, I’m pretty sure it always chooses the first one. To get around this use a table and use math.random to pick a number. Then get the win or lose from the table using that index.
The problem is you’re doing this in the local script,
Rule, You cannot change any sort of values inside local scripts, unless it has a remote event/function
You can add a math.Random to see if it’s a win or lose
script.Parent.MouseButton1Click:Connect(function()
local k
local number = math.Random(1,2)
if number = 1 then
k = "win"
else
k = "lose"
end
script.Parent.Parent.WinLose.Value = k
end)
But still, i would recommend you fire a remote event, because the values only change on the client and not on the server