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

So, I tried disconnecting my OnKeyPress Function, and stopping the player from sprinting?

Asked by
OFF_S4LE 127
3 years ago

So, I tried disconnecting my OnKeyPress Function, and stopping the player from sprinting. A bigger problem them comes into the script. My roblox studio freezes for like 10 seconds after undoing the sprint. I know why, I just don't know how to fix it

error:

https://imgur.com/a/6ow6MU7

Script:

001-- Services
002local runService = game:GetService("RunService")
003 
004local tweenService = game:GetService("TweenService")
005local playersService = game:GetService("Players")
006 
007-- Variables
008local player = playersService.LocalPlayer
009local character = player.Character or player.CharacterAdded:Wait()
010local humanoid = character:WaitForChild("Humanoid")
011 
012local camera = workspace.CurrentCamera
013 
014-- Settings
015local normalSpeed = 16
View all 107 lines...

2 answers

Log in to vote
1
Answered by
imKirda 4491 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

We talked about this in chat nobs.

Ad
Log in to vote
0
Answered by 3 years ago

The error is doing it because it's constantly being interfered with. On line 49, your character will constantly be running I think? Correct me if I'm wrong. Not sure how to fix it.

0
After not holding down c the player stops sprinting, the game just freezes OFF_S4LE 127 — 3y
0
No clue... Krektonix_Youtube 85 — 3y

Answer this question