Image won't load/show up

Hi!

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

script.Parent.MouseButton1Click:Connect(function()
	if clicked then
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 64
		script.Parent.Image = "http://www.roblox.com/asset/?id=1488065691" -- The running image ID
		clicked = false
	else
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
		script.Parent.Image = "http://www.roblox.com/asset/?id=265205655" -- The walking image ID
		clicked = true
	end
end)

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

2 Likes

Thanks! Worked! (30 characters)