Hi there! I want an icon to show up and disappear (using ImageTransparency) when a player has a certain speed (in this case WalkSpeed must be 16).
local Player = game.Players.LocalPlayer
local Character = Player.Character
if Character.Humanoid.WalkSpeed == 16 then
script.Parent.ImageTransparency = 0
end
if Character.Humanoid.WalkSpeed == 11 then
script.Parent.ImageTransparency = 1
end
This however.. gives me the following error:
Players.baukeblox12.PlayerGui.Stamina.Frame.SprintImage.LocalScript:5: attempt to index nil with 'Humanoid'
I am new to Roblox Development! So some explanation would be appreciated! :D

4 comments
Thanks for the help! I don't understand some code here.. Why do you add or Player.Character because you know that Player.Character will not work anyway
So what the code is doing is basically choosing whichever one works. Player.Character or Player.CbaracterAdded. Since one of them works; Player.CharacterAdded:Wait(), it waits for the Character to load. Character Added isn't the same as Player.Character. The code is checking to see if one or the other gives an error, so since CharacterAdded will give an error later on, you put or Player.Character
Basically, Player.CharacterAdded isn't the same thing, it just tells it to wait for the Character to be added, then you later define what character really is.
Apologies if you don't understand what I mean. I'm super tired and also on mobile.