Image won't load/show up


So I used the following code in a LocalScript (located in an ImageButton) to make a sprint button. When the WalkSpeed is set to 16 (the default), I have an image of walking displayed on the ImageButton. When the button is clicked, the WalkSpeed is changed to 64 and the code changes the image to running. However, when I click the button in game, my WalkSpeed changes accordingly, but the image for my ImageButton won’t show up.

Here’s the code:

local clicked = false

	if clicked then
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 64
		script.Parent.Image = "" -- The running image ID
		clicked = false
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
		script.Parent.Image = "" -- The walking image ID
		clicked = true

I tried using a different running image ID, but either way it still wouldn’t load.

Any ideas as to what the error is? Thanks in advance!

1 Like

Do this:

Make decal on workspace
Put the roblox website link from your images to the image of decal or texture
wait until the value changes
copy the value from there, paste it into your code


Thanks! Worked! (30 characters)