How to fix this waitforchild

how to fix this waitforchild

Players.MadionChooi.Backpack.TheWorld.Summon:13: attempt to index nil with 'WaitForChild'

image
image

Can you show a line, where you define the char variable?

my full script

local UIS = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
local char = player.Character
local event = game:GetService("ReplicatedStorage").Stand.TheWorld.Summon

local CD = 2
local debounce = false

UIS.InputBegan:Connect(function(input, gamepro)
	if gamepro then
		return
	elseif input.KeyCode == Enum.KeyCode.Q then
		if char:WaitForChild("UsingMove").Value == false then
			if debounce == false then
				debounce = true
				event:FireServer()
				wait(CD)
				debounce = false
			end
		end
	end
end)

Define character as player.Character or player.CharacterAdded:Wait()

1 Like