View difference between Paste ID: Ys7C8wQh and YHf2cs1C
SHOW: | | - or go back to the newest paste.
1-
-- This script has been converted to FE by iPxter
1+
2
3
plr = game.Players.LocalPlayer
4-
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
4+
5-
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
5+
6-
do
6+
7-
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
7+
8-
	script.Parent = Player.Character
8+
9
tool.Selected:connect(function()
10-
	--RemoteEvent for communicating
10+
11-
	local Event = Instance.new("RemoteEvent")
11+
if tool.Active == true and mouse.Target.Parent:FindFirstChild("Humanoid") or mouse.Target.Parent.Parent:FindFirstChild("Humanoid") or mouse.Target.Parent:FindFirstChild("Torso") or mouse.Target.Parent.Parent:FindFirstChild("HumanoidRootPart")then
12-
	Event.Name = "UserInput_Event"
12+
13
local hrp = torso.Parent:FindFirstChild("HumanoidRootPart")
14-
	--Fake event to make stuff like Mouse.KeyDown work
14+
15-
	local function fakeEvent()
15+
16-
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
16+
17-
		t.connect = t.Connect
17+
local blast = Instance.new("Sound")
18-
		return t
18+
blast.SoundId = "rbxassetid://2302540815" --2686077452
19-
	end
19+
blast.Volume = 4
20
blast.Parent = hrp
21-
	--Creating fake input objects with fake variables
21+
22-
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
22+
local blst = Instance.new("Sound")
23-
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
23+
blst.SoundId = "rbxassetid://2302540815" --2686077452
24-
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
24+
blst.Volume = 4
25-
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
25+
blst.Parent = hrp
26-
	end}
26+
27-
	--Merged 2 functions into one by checking amount of arguments
27+
28-
	CAS.UnbindAction = CAS.BindAction
28+
29
plrname = plr.Character.Name
30-
	--This function will trigger the events that have been :Connect()'ed
30+
31-
	local function te(self,ev,...)
31+
blast:Play()
32-
		local t = m[ev]
32+
33-
		if t and t._fakeEvent and t.Function then
33+
blst:Play()
34-
			t.Function(...)
34+
wait(1.90)
35-
		end
35+
36-
	end
36+
37-
	m.TrigEvent = te
37+
38-
	UIS.TrigEvent = te
38+
39
end)