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.
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.
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”.
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.
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.