Im trying to make a TextButton that gives a tool named AWP when pressed, these are my scripts
--local script local awpSpawn = game.ReplicatedStorage:WaitForChild("AwpSpawn") script.Parent.MouseButton1Click:Connect(function() game.Players.LocalPlayer.PlayerGui.MainGUI.Guns.Visible = false if script.Parent.Frame.AwpButton.ImageLabel.Visible == true then awpSpawn:FireServer() end end)
--server script
local awpSpawn = Instance.new("RemoteEvent") awpSpawn.Parent = game.ReplicatedStorage awpSpawn.Name = "AwpSpawn" local awpTool = game.ReplicatedStorage.AWP local awpToolClone = awpTool:Clone()
awpSpawn.OnServerEvent:Connect(function(plr) if awpToolClone.Parent ~= plr.Backpack then awpToolClone.Parent = plr.Backpack end end)
then it gives me this error Infinite yield possible on 'ReplicatedStorage:WaitForChild("AwpSpawn")'

1 comment
It's not an error. It's a warning. Try FindFirstChild().