ServerScriptService.Script:5: attempt to index nil with 'Character' help?
Asked by
5 years ago Edited 5 years ago
So i have a problem with my script
https://gyazo.com/d01fd3948fa7efdf7eda62a5b2ebe197
at line 5
https://gyazo.com/41e3022b7efa9e3d6872f2361b236ea1
01 | local player = game.Players.LocalPlayer |
04 | local plr = game.Players.LocalPlayer |
05 | local Char = player.Character |
06 | local rp = Char:WaitForChild( "HumanoidRootPart" ) |
08 | local Debris = game:GetService( "Debris" ) |
09 | local Character = player.Character or script.Parent |
11 | local Humanoid = Character.Humanoid |
15 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
16 | local RemoteEvent = ReplicatedStorage:WaitForChild( "RemoteEvent" ) |
17 | TweenService = game:GetService( "TweenService" ) |
19 | local function RemoveEffect(Ep,Tbr,Len,GSize,GCFrame,GTrans) |
22 | TweenService:Create(Ep,TweenInfo.new(Len,Enum.EasingStyle.Linear), { Transparency = GTrans,Size = GSize,CFrame = GCFrame } ):Play() |
23 | Debris:AddItem(Ep,Len+ 0.5 ) |
27 | RemoteEvent.OnServerEvent:Connect( function (player, AnimationID, Sound 1 , Sound 4 , Sound 3 ) |
28 | local Animation = Instance.new( "Animation" ) |
29 | Animation.AnimationId = AnimationID |
30 | local LoadAnimation = Humanoid:LoadAnimation(Animation) |
32 | local Tool = script.Parent |
33 | local Blade = Tool:WaitForChild( "Blade" ) |
34 | local Trail = Blade:WaitForChild( "Trail" ) |
37 | local Character = player.Character or player.CharacterAdded:Wait() |
38 | local RootPart = Character.HumanoidRootPart |
39 | plr.Character.Humanoid.WalkSpeed = 0 |
40 | local BV = Instance.new( "BodyVelocity" ) |
41 | BV.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
42 | BV.Velocity = RootPart.CFrame.lookVector.Unit * 65 |
47 | local WW = ReplicatedStorage:WaitForChild( "WaterWheel" ):Clone() |
48 | WW.Size = Vector 3. new( 10.1 , 10.1 , 5.1 ) |
53 | WW.CFrame = rp.CFrame * CFrame.Angles( 5 , 1.5 , 0 ) |
55 | TweenService:Create(WW,TweenInfo.new( 0.25 ,Enum.EasingStyle.Linear), { Size = Vector 3. new( 23.44 , 26.943 , 1.834 ),Transparency = 0.5 ,CFrame = rp.CFrame * CFrame.Angles( 10 , 1.5 , 0 ) } ):Play() |
56 | RemoveEffect(WW, 0.3 , 0.25 ,Vector 3. new( 0.1 , 0.1 , 0.1 ),rp.CFrame * CFrame.Angles( 10 , 1.5 , 0 ), 1 ) |
72 | plr.Character.Humanoid.WalkSpeed = 16 |