for some reason the player can just walk the normal speed even though i set there speed to 0. I made sure the server printed out the value of the speed and it printed out as 0 (the value i set) but the player is still able to move, it was working before but now no other scripts can affect the player speed, i even changed all the player speed changes only on server script and the local scripts got to fire a remote event to change the value but it still doesnt work. Ive read multiple articles but this problem has not been fixed (pls help if you can)
can we see the code? I feel like that might help.
Maybe you have some kind of script that adds some value to the speed?
It just can’t be that the speed is 0 but the player is moving
it quite literally is that all the scripts are in the serverscriptservice and they all output as the value i added but yet the player is able to move
all the code has plr.Character.Humanoid.WalkSpeed
and detects it but yet it doesnt change anything
ok can I see the code please, It would still help yo
I think it might be a problem with your code. I made a demo to test your claim and it seems to be working as expected for me.
Put this script in StarterCharacterScripts:
wait(5)
print('now')
script.Parent.Humanoid.WalkSpeed = 0
If that doesn’t work, anchor the HumanoidRootPart.
Try this server script as well:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.Humanoid.WalkSpeed = 0
end)
end)
alr
script responsible to change for the client
game.ReplicatedStorage.Events.Plr.SetSpeed.OnServerEvent:Connect(function(plr, speed)
plr.Character.Humanoid.WalkSpeed = tonumber(speed)
end)
script responsible for respawning them, then giving attaching an item
game.ReplicatedStorage.Events.Plr.SetChar.OnServerEvent:Connect(function(plr, char)
plr.Info.WhatChar.Value = tostring(char)
if tostring(char) == "Straw Doll User" and not plr.Character:FindFirstChild("StrawDollHammer") and not debounce then
debounce = true
plr:LoadCharacter()
plr.Character.Loading.Value = true
plr.Character.Humanoid.WalkSpeed = 0
wait(0.3)
-- attaches a weapon to player
wait(0.3)
plr.Character.Humanoid.WalkSpeed = 16
plr.Character.Loading.Value = false
debounce = false
end
end)
Attack script
game.ReplicatedStorage.Events.Plr.Hit.OnServerEvent:Connect(function(plr, hit, hitNum)
local char = plr.Character
if hit then
local block = Instance.new("Part")
local hit = false
char:WaitForChild("Humanoid").WalkSpeed = 7
print(char:WaitForChild("Humanoid").WalkSpeed)
block.Parent = workspace
block.Transparency = 0
block.CanCollide = false
block.Size = Vector3.new(3,3,3)
block.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
local attach = Instance.new("WeldConstraint")
attach.Parent = block
attach.Part0 = plr.Character.HumanoidRootPart
attach.Part1 = block
block.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") and part.Parent.Name ~= plr.Name then
hit = true
print("Touched", part.Parent.Name)
part.Parent.Humanoid.Health -= 0.7
end
end)
wait(0.001)
block:Destroy()
if tonumber(hitNum) == 4 and not hit then
char:WaitForChild("Humanoid").WalkSpeed = 0
print(char:WaitForChild("Humanoid").WalkSpeed)
end
task.wait(2)
char:WaitForChild("Humanoid").WalkSpeed = 16
print(char:WaitForChild("Humanoid").WalkSpeed)
end
end)
i attempted to see if it even changes with print the value, it displays the intended value but it doesnt change anything
and this happened all of a sudden
all 3 scripts dont change the speed in game
doesnt affect the player and it printed a 0
Can you put the print in a loop of the speed, there might be a script that keep setting 16 walkspeed
i found a problem it doesnt actually change but it prints as a 0
(pov from the server)
also theres no while or repeat loops in any script
Exactly there must be a script ANYWHERE in the explorer that keep setting that walkspeed, use Find All feature and find that script.
i had already done that there is no script that does that
Then in a loop keep setting the walk speed to 0 and stop the loop whenever you want (alternative solution: anchor the HumanoidRootPart)
alr but i cant just anchor as i dont just stop the player
Unanchor it if you want to move the player.
found the error made a custom run script but (idk how) overrides the if statements so it just changes the walkspeed
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.