Ok so to be brief. I am scripting a game where someone is selected to be the leader of a mini game and the leader is given a GUI and in the textbox they can type in a players name and send an air drop to them. The GUI is working fine and the tween event for the airdrop is perfectly fine, but the problem is that when I type in a players name into the textbox and click send, the server doesn't recognize the players name and completely halts the script. Nothing in the "output" is described as being an error so I am just lost. Please help.
game.ReplicatedStorage.sendgun.OnServerEvent:Connect(function() local val = script.Parent.TextBox.Value.Value ---- This is where the Players name is being typed local text = script.Parent.TextBox val = text.Text local plr = game.Workspace:FindFirstChild(val) --- Finding the username in game. local val2 = script.Parent.dis.Value.Value -- This is where they type the kind of gun to send. local text2 = script.Parent.dis val2 = text2.Text if plr and plr:FindFirstChild("Humanoid") then ---- THIS LINE IS THE PROBLEM!!! ---After this the airdrop gets cloned into workspace and sent to the person via a tween event---