i want make a skill what i can press a key (P) and it activate, and with magnitude make it stun ppl what get close to me, i know how to make the stun thing and magnitude thing, but idk how to make it a Skill what i can just have it and when i press P it activate, if i press P again it deactivate, some help? its my script what i've made, is just for make a example of what i have done. (and no, i dont want make it in a tool, i sent this script just for a example, i want make it like a skill what i can just press P and it activate, without Tools and nothing else).
local UIS = game:GetService("UserInputService")
local p = Enum.KeyCode.P
local players = game:GetService("Players")
local stun = false
local tool = script.Parent
local function onEquip()
local char = tool.Parent
for _, v in pairs(players:GetChildren()) do
if v.Character ~= char then
if (v.Character.Head.Position - char.Head.Position).magnitude <=15 then
v.Character.Humanoid.WalkSpeed = 1
v.Character.Humanoid.JumpPower = 0
end
end
end
end
UIS:IsKeyDown(p):Connect(onEquip)

6 comments
i put the first script in a Local script inside the Tool, right? and the second one in a script inside the ServerScriptService?, if yes, ok, but i dont want make it in a tool, i sent that script just for a example
if you dont want it as tool then just use
https://pastebin.com/ujKdNnkS
and put in starterplayerscripts
Bravo "Mouse.KeyDown"
TTChaos shut ur furry 487 visits up