UIS Firing with other inputs or just not firing at all

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    to have my character press Q and not have the effect bugged out
  2. What is the issue? Include screenshots / videos if possible!
    https://gyazo.com/045e90edbb9902a3c0ee985788566886
    the entire time i was spamming Q which is supposed to make my character do a sort of teleport move but it didnt work until way after, as well as the particle randomly emits from my player if other buttons are pressed
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ive tried changing the entire way i coded it but only got further from where i am, and have looked for similar issues on the forums here but i havent found anything similar
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

We aren’t able to fix your issue if you won’t provide us with neccessary things like code. Please make sure to provide the script. If its about how to make something then you don’t neccessarily need to provide the code.

2 Likes

sorry about that i couldve swore i pasted it here before i pressed send, but anyways here it is

local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local UIS = game:GetService('UserInputService')

local LastTapped,Tapped = false,false

local Run = hum:LoadAnimation(script:WaitForChild("Sprint"))

local plr = game.Players.LocalPlayer

local char = plr.Character

local hrp = char.HumanoidRootPart

local FOV = 70

hum.WalkSpeed = 12

--Run

UIS.InputBegan:Connect(function(Input, IsTyping)

	if IsTyping then return end

	if Input.KeyCode == Enum.KeyCode.W then

		if Tapped == false then

			Tapped = true

		else

			LastTapped = true

			Tapped = false

			Run:Play()

			local properties = {FieldOfView = FOV + 5}

			local Info = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)

			local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)

			T:Play()

			hum.WalkSpeed = 30

		end

		delay(.4, function()

			if Tapped then

				Tapped = false

			end

		end)

	end

end)

UIS.InputEnded:Connect(function(Input, IsTyping)

	if IsTyping then return end

	if Input.KeyCode == Enum.KeyCode.W and LastTapped and not Tapped then

		hum.WalkSpeed = 12

		local properties = {FieldOfView = FOV}

		local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)

		local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)

		T:Play()

		Run:Stop()

	end

end)

--Flashstep

local flashstepcd = false
local sorufx = script.sorufx.FlashstepParticle

UIS.InputBegan:Connect(function(Input2, IsTyping)
	
	if IsTyping then return end
	
	if flashstepcd then return end
	
	flashstepcd = true
	
	local parts = char:GetDescendants()
	
	if Input2.KeyCode == Enum.KeyCode.Q then
		
			
		print("Flashstep")
		
		hum.WalkSpeed = 60
		
		sorufx.CFrame = hrp.CFrame
		sorufx.Attachment.ParticleEmitter:Emit(100)
		sorufx.Transparency = 1
		
		for i,v in pairs(parts) do
			
			if v:IsA("BasePart") or v:IsA("Decal") then
				
				v.Transparency = 1
				sorufx.Transparency = 1
				
			end
		end	
	
	wait(1)
	
	hum.WalkSpeed = 12
	
	for i,v in pairs(parts) do
		
		if v:IsA("BasePart") or v:IsA("Decal") then
			
			v.Transparency = 0
			sorufx.Transparency = 1
			
		end
	end
	
	sorufx.CFrame = hrp.CFrame
	sorufx.Attachment.ParticleEmitter:Emit(100)
	sorufx.Transparency = 1

	plr.Character.HumanoidRootPart.Transparency = 1
	
	Run:Stop()
	
	wait(3)
	
	flashstepcd = false
		
	end
	
end)
1 Like

It would be a headache to help you if you paste your code without it being formated.
Please format you code by typing 3 backquotes (“`”) before and after your code. Or by clicking this button image.

1 Like

sorry about that i went ahead and fixed it

Ah no problem. And sorry from me because I can’t view it right now, I will fix it tomorrow as its quite late for me.

all good just let me know how it goes thanks :smiley:

any progress on how it can be fixed?

nvm i ended up fixing it and figured out what the problem was

Ah sorry about that. I forgot to tell you but I wasn’t able to. Glad you found a way. I am sorry for wasting your time.

all good dude hope you have a good one :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.