local room = script.Parent.Background.Room.Text
local name = script.Parent.Background.Name.Text
local key = script.Parent.KeyName.Value
script.Parent.Background.GiveKey.MouseButton1Down:connect(function()
print "1"
local newkey = game.StarterPlayer[key]:Clone()
newkey.Room.Value = room
local plr = game.Workspace[name]
newkey.Parent = plr
end)
Error: 11:31:43.577 - Players.joshmatt1245.PlayerGui.RoomManager.Script:9: bad argument #2 to '?' (string expected, got nil)
11:31:43.577 - Stack Begin
11:31:43.578 - Script 'Players.joshmatt1245.PlayerGui.RoomManager.Script', Line 9
11:31:43.578 - Stack End
This is the error I get when I press on the "GiveKey" button.
wapjkmdwajdawoipdjiawjdoijodjjawjdaoiwjiodjawoidjawjdoiajwoidjioawjdoiawjoidjwaiojdawjidjawod

1 comment
More appropriate as comment then answer