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

[Solved] My script is not working how I expected?

Asked by 4 years ago
Edited 4 years ago

Hey there! I am making a script where you can to the enemy the mouse is pointing at. The only problem however, is that you would still be able to dash, even when the mouse is off the enemy or you moved the specified 40 studs away from the enemy

Here is that script:

01--[[ Values ]]--
02local canDash = true
03local looping = true
04 
05--[[ Math ]]--
06 
07--[[ Services ]]--
08local runService = game:GetService("RunService")
09local userInputService = game:GetService("UserInputService")
10 
11--[[ Player Variables ]]--
12local player = game:GetService("Players").LocalPlayer
13local character = player.Character or player.CharacterAdded:Wait()
14local mouse = player:GetMouse()
15 
View all 49 lines...

Any help is appreciated!

0
print distance after you set that variable and see if that is working as you intend cmgtotalyawesome 1418 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I fixed it. All I did was add a debounce after the print.

Ad

Answer this question