So I am getting this error
Error:
10:44:05.690 - wait(1)
10:44:05.691 - ----Services----
10:44:05.692 - local ReplicatedStorage = game:GetService("ReplicatedStorage")
10:44:05.692 - local UserInputService = game:GetService("UserInputService")
10:44:05.694 - (x2)
10:44:05.695 - ----Variables----
10:44:05.695 -
10:44:05.696 - local player = game.Players.LocalPlayer
10:44:05.696 - local Char = player.Character
10:44:05.697 - local Mouse = p:12: attempt to index nil with 'WaitForChild'
Code which is erroring:
local RootPart = Char:WaitForChild("HumanoidRootPart")
Full Code:
wait(1)
----Services----
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
----Variables----
local player = game.Players.LocalPlayer
local Char = player.Character
local Mouse = player:GetMouse()
local RootPart = Char:WaitForChild("HumanoidRootPart")

5 comments
also you dont need that wait(1)
Ok
Also I get an infinite yield how do I fix that?
if you get an infinite yield that means the character or the rootpart doesnt exist
what @DarkDanny04 said :)