Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How come my character's WalkSpeed is 16 but my character behaves as if it's 0?

Asked by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

This is a very odd problem. All the print()'s are printing, and the WalkSpeed is getting changed the way it's supposed to, 0 when you press / and 16 when you press Enter. However, when you press enter your character still behaves as if your WalkSpeed is 0, even though I know it is 16! I know it is 16 because I used the Developer Console to run the code, print(Workspace.Perci1.Humanoid.WalkSpeed) and it printed 16.

But now it gets even weirder; before I ran that print command, it looked as if my WalkSpeed remained at 0. However, after I ran that code, and it printed '16', my WalkSpeed went back to normal again!

Why would my WalkSpeed get changed to 0, then 16, but still behave as if it was 0? And how come after I used the Developer Console to print something, it behaved normally again?

Here's the LocalScript:

local plr = game.Players.LocalPlayer
    repeat wait() until plr.Character
local chr = plr.Character
local mouse = plr:GetMouse()

local startCommand = "/" 

local addToString = false
local theString = ""

game.StarterGui:SetCoreGuiEnabled("Chat", false)

mouse.KeyUp:connect(function(key)
    if key == startCommand and not addToString then
        addToString = true 
        chr:WaitForChild("Humanoid").WalkSpeed = 0
        print("speed is 0")
    elseif key:byte() == 13 and addToString then --13 = "Enter"
        theString = ""
        addToString = false
        chr:WaitForChild("Humanoid").WalkSpeed = 16
        print("speed is 16")
    elseif key:byte() ~= 13 and addToString then
        theString = theString..key
    end
end)
0
Maybe you would need to change the WalkSpeed via a Script using a RemoteFunction or something like that. Not too sure. Spongocardo 1991 — 9y
0
I've noticed this in some games, I think its a bug within Roblox that the Admins have not noticed yet. So far, hopefully, its just a bug. TheeDeathCaster 2368 — 9y
0
Dang it... If it's a bug is there anything I can do to fix it? Perci1 4988 — 9y
0
I don't know, it happens sometimes in game, its even occured with a few of my scripts, so, I guess we'll just have to wait and see. :/ Sorry about the inconvenience. ;-; TheeDeathCaster 2368 — 9y
View all comments (4 more)
0
qq Perci1 4988 — 9y
0
By the way, if you want to contact me, I'm 'TheeDeathCaster' on the Roblox website, I read all my Messages, when I notice when I get one. :P TheeDeathCaster 2368 — 9y
0
While not a real solution, have you tried doing a short `wait()` immediately before setting the WalkSpeed back to 16? Sometimes quirks like this can be fixed by brief pauses BlueTaslem 18071 — 9y
0
I have not, I'll try that. Perci1 4988 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Probably because you press "/" to chat and set the start command to "/" also.

0
Did you not read line 11? Perci1 4988 — 9y
Ad

Answer this question