So basically i was working on a tool that stuns players. Most of the script is working with not problem but i still could not figure out how to blur player’s vision when touched the tool.
Well i tried putting it in local script but that would limit other things so i added one server script and remote event. Didn’t work out either. So i went looking on devforum and developer hub and i didn’t find the solution.
So i gave up and posted this topic…
I don’t want to sound like i want the entire scripts, because i completely deleted the code.
So i just want a help how would i make it working.
I am not good at english so you may not understand what i want to achieve
@Ligij That’s the starting of the solution.
You should fire the RemoteEvent in the script, when a Touch event is fired (you should make sure that the tool has touched a player that has a humnaoid in it).
Let me know if you need help with that^
Here is the outline of how I would do it. It is quite janky but it will work
(This will not work if you just past it. you have to write the code yourself, but I gave you everything you needed to put together the script)
get local player
get remote event
mouse click event
if not debounce
set debounce to true
fire server your mouse.Target
wait 1 second
set debounce to false
remote event on client event
play tween for blur that sets size to 24
wait however long you want
play tween for blur that sets size to 0
get remote event
define debounce (table)
remote event on server event (params player, mouse target)
define targetplayer = game.Players:GetPlayerFromCharacter(target:FindFirstAncestorWhichIsA(model))
if not debounce[player] and targetplayer then
debounce[player] = true
stun the targetplayer using ragdoll idk
wait(.9) -- gotta be a bit less just in case of overlap
debounce[player] = false