So i have a problem with my script
https://gyazo.com/d01fd3948fa7efdf7eda62a5b2ebe197
at line 5
https://gyazo.com/41e3022b7efa9e3d6872f2361b236ea1
local player = game.Players.LocalPlayer
local plr = game.Players.LocalPlayer
local Char = player.Character
local rp = Char:WaitForChild("HumanoidRootPart")
local Debris = game:GetService("Debris")
local Character = player.Character or script.Parent
local Humanoid = Character.Humanoid
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
TweenService = game:GetService("TweenService")
local function RemoveEffect(Ep,Tbr,Len,GSize,GCFrame,GTrans)
spawn(function()
wait(Tbr)
TweenService:Create(Ep,TweenInfo.new(Len,Enum.EasingStyle.Linear),{Transparency = GTrans,Size = GSize,CFrame = GCFrame}):Play()
Debris:AddItem(Ep,Len+0.5)
end)
end
RemoteEvent.OnServerEvent:Connect(function(player, AnimationID, Sound1, Sound4, Sound3)
local Animation = Instance.new("Animation")
Animation.AnimationId = AnimationID
local LoadAnimation = Humanoid:LoadAnimation(Animation)
LoadAnimation:play()
local Tool = script.Parent
local Blade = Tool:WaitForChild("Blade")
local Trail = Blade:WaitForChild("Trail")
Trail.Enabled = true
local Character = player.Character or player.CharacterAdded:Wait()
local RootPart = Character.HumanoidRootPart
plr.Character.Humanoid.WalkSpeed = 0
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = RootPart.CFrame.lookVector.Unit * 65 --
Sound1:Play()
Sound4:Play()
spawn(function()
local WW = ReplicatedStorage:WaitForChild("WaterWheel"):Clone()
WW.Size = Vector3.new(10.1,10.1,5.1)
WW.Transparency = 0
WW.Anchored = true
WW.CanCollide = false
wait(0.77)
WW.CFrame = rp.CFrame * CFrame.Angles(5,1.5,0)
WW.Parent = workspace
TweenService:Create(WW,TweenInfo.new(0.25,Enum.EasingStyle.Linear),{Size = Vector3.new(23.44, 26.943, 1.834),Transparency = 0.5,CFrame = rp.CFrame * CFrame.Angles(10,1.5,0)}):Play()
RemoveEffect(WW,0.3,0.25,Vector3.new(0.1,0.1,0.1),rp.CFrame * CFrame.Angles(10,1.5,0),1)
Sound3:Play()
end)
BV.Parent = RootPart
wait(1)
Trail.Enabled = false
BV:Destroy()
plr.Character.Humanoid.WalkSpeed = 16
wait(2)
Sound1:Stop()
Sound4:Stop()
end)

5 comments
Change local Char = player.Character to local Char = player:WaitForChild("Character") ? Since the character isn't loaded yet when the script is working
15:25:40.943 - ServerScriptService.Script:5: attempt to index nil with 'WaitForChild'
Is your script a local script? cause you can't use localplayer on normal script (Also local script doesn't work in ServerScriptService)
https://developer.roblox.com/en-us/api-reference/property/Players/LocalPlayer
its script