Game Ignoring My StarterCharacterScript

I am, trying to create a jogging system, with UserInputService, it’s a client script, inside of “StarterCharacterScripts” the code does exactly what i want it to do, inside of client testing, and client/server testing, however when i play the real game, roblox just ignores my script, and doesn’t do anything.

The code checks for a Boolean, value to see if its true or false, to jog or not.
I tried “WaitForChild” for the Boolean value, and tried in the real game, roblox still ignores the script.

Every other script inside of “StarterCharacterScripts” work, and have no issue, in studio, or in the real game.

Here is my code:

-- Default walkspeed for testing
local defaultwalkspeed = 11
 
local UIS = game:GetService("UserInputService")

local is_jogging = script.Parent:WaitForChild("is_jogging")

local player = script.Parent


player.Humanoid.WalkSpeed = defaultwalkspeed


UIS.InputBegan:Connect(function(input)
   if input.KeyCode == Enum.KeyCode.X then

 if is_jogging.Value == false the
player.Humanoid.WalkSpeed = 15
			print("jogging")
			is_jogging.Value = true
elseif is_jogging.Value == true then
			player.Humanoid.WalkSpeed = defaultwalkspeed
			script.Parent.is_jogging.Value = false 
         end
    end
end)

Does anyone know why roblox would do this? Thank you.

Is is_jogging a boolValue inside the character or inside the script?

1 Like

You mean playing the game from the website?

First
Make sure you are Publishing the game to roblox, not Saving to roblox.

Refer to my reply in another post:

It is inside of the character, wen the user joins inside of the game.

Yeah, from the website.
It published to roblox correctly, as all the other updates i made, were shown at the same time.

I’ve tested your same exact script and it works fine, both in studio and the game. The only change I did was add the boolvalue “is_jogging” to my character by doing

local jogvalue = Instance.new("BoolValue", workspace.astra_wr)
jogvalue.Name = "is_jogging"

My best bet is that:

you accidently thought that is_jogging is inside the script, so it should be script:WaitForChild("is_jogging") instead. script.Parent would refer to the player’s character (based on your script.)

(my bad, you can’t really notice the difference but I do, I’ll uplodad another gif in a sec.)

If you say so, re-check the script that handles the creation of the jog value instance.

1 Like

The post mentions that the BoolValue is inside the character, so doing

script.Parent:WaitForChild("is_Jogging")

would be correct

1 Like

Since the script is inside of “StarterCharacterScript” when you do “script.Parent” it refers to your character now, the script goes inside of the character, so now you can access anything in the character with “script.Parent”.

Are you in a team create session?

1 Like

I know, that’s exactly why I’m confused on why it doesn’t work, when it works totally fine for me.

1 Like

Yes, i am inside of one with another user.

Yeah, it is weird, cause nothing else in my game, should cause this to happen.

Oh, in that case. I just solved the exact same issue a while ago with someone:

I believe there’s a way to publish script changes when in team create since the new collaborative script editing was introduced. Unfortunately, I am inexperienced with team create, so I cannot suggest any other solutions other than disabling team create. I am also unsure if this is a bug as I haven’t tried out team create’s new features yet.

Ahh alright i see, thank you, appreciate it.

I’ve discovered that this was not team create it was collaborative editing for scripts.

Yes, collaborative script editing is a feature within team create. I wouldn’t be so sure which exactly is responsible for the script changes being published.

1 Like

You were right, i forgot all about it, you have to commit everything before publishing.

1 Like