I tried making two server scripts (placed in Workspace, I’m not sure if that can be troublesome) where the player should get rewarded if they chat a number that matches the value they have as a child, but I can’t get it to work. It’s probably something related with the “if msg == plr.tnumber.Value then” line, but I’m not sure. Thanks in advance!
game.Players.PlayerAdded:connect(function(plr)
local tnumber = Instance.new("IntValue")
tnumber.Name = "tnumber"
tnumber.Value = math.random(100000,999999)
tnumber.Parent = plr
end)
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == plr.tnumber.Value then
print("works!")
end
end)
end)