I dont know why it says "Attempt to index nil with 'Character'

I needed to get the Character from the Player for the WalkSpeed but now even if all possible Ideas i had i ended with …
image

My Script:
image

It’s a server script. You can’t say Players.LocalPlayer

Something like this should be able to define a player: Players:GetPlayers()[1]

Players is defined by local Players = game:GetService(“Players”)

it means that the player has a nil value and because it’s a server script it means Players.LocalPlayer doesn’t work you could do

game.Players.PlayerAdded:Connect(function(player)
  player.CharacterAdded:Connect(function(char)
          local myValue = char.Humanoid.WalkSpeed
  end)
end)

Basically im trying to Tween the Speed so it has a smooth transition but it says
image
and after editing it to

myValue = char.Humanoid.WalkSpeed.Value

image

A can I see the tween script and B WalkSpeed isn’t a value it is just .WalkSpeed

Sure.

TS:Create(myValue, TweenInfo.new(1,Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true, 0), {Value = 32}):Play() -- Should tween from 16 to 32 in 1 seconds and reverse.

Change to: myValue = char.Humanoid.WalkSpeed

Already did and it outputs:

Show me lines 50-55 in the GroundBounce script.

WallL.Touched:Connect(function(hit) -- Left Wall
	if touching == false then
		local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)

		if player then
			touching = true
			game.Workspace.Gravity = 196.2 --Changes to normal Gravity while Flying Up
			local bv = Instance.new("BodyVelocity")
			bv.Name = "bounce"
			bv.Velocity = Vector3.new(40,0,0) --change the y value
			bv.MaxForce = bv.MaxForce * 50 --change this
			bv.Parent = player.Character.HumanoidRootPart
			task.wait(0.1)
			bv:Destroy()
			touching = false
			game.Workspace.Gravity = 50 --Chnages Back to low gravity since Falling
			TS:Create(myValue, TweenInfo.new(1,Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true, 0), {Value = 32}):Play() -- Should tween from 16 to 32 in 1 seconds and reverse.
		end
	end
end)

what you should be doing for your tween script is

local Ts = game:GetService('TweenService')
local Tinfo = TweenInfo.new(1,
Enum.EasingStyle.Quad, 
Enum.EasingDirection.Out, 
0, 
true, 
0)

game.Players.PlayerAdded:Connect(function(player)
  player.CharacterAdded:Connect(function(char)
          local myValue = char.Humanoid.WalkSpeed
          local tween = Ts:Create(char.Humanoid,Tinfo,{WalkSpeed = 32})
          tween:Play()
  end)
end)

just added a bit of formatting to make it clearer

1 Like