I have seen this before but how can i get it to work?
✓ ANSWER ACCEPTED
how do you make particles appear on a player when they press a certain key?
2 answers
✓ Accepted answer
I have gotten you an example script to show you how you can work with key press events.
This scripts detects when a button is pressed and if the button is f then it will make particles appear on the players head. I did have to use a remote event for this since clients cant make a new instance unless you want the particles only to be on their screen.
LOCAL SCRIPT (inside of startergui)
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "f" then
game:GetService("ReplicatedStorage").Key:FireServer()
end
end)
SERVER SCRIPT
game:GetService("ReplicatedStorage").Key.OnServerEvent:connect(function(plr)
local Particle = Instance.new("ParticleEmitter",plr.Character.Head)
end)
Enjoy! And if you have any questions please message me!
1 comment
0
KeyDown is deprecated.
You could use UserInputService.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Not a request site