View difference between Paste ID: tyMSRiLy and 7w4e16r8
SHOW: | | - or go back to the newest paste.
1
-- This script has been converted to FE by iPxter
2-
local player=game.Players.LocalPlayer;
2+
3-
local char=game.Players.LocalPlayer.Character;
3+
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5-
Tool=Instance.new('Tool', game.Players.LocalPlayer.Backpack);
5+
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
6
do
7
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
8
	script.Parent = Player.Character
9
10
	--RemoteEvent for communicating
11
	local Event = Instance.new("RemoteEvent")
12
	Event.Name = "UserInput_Event"
13
14
	--Fake event to make stuff like Mouse.KeyDown work
15
	local function fakeEvent()
16
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
17
		t.connect = t.Connect
18
		return t
19
	end
20
21
	--Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
	end}
27
	--Merged 2 functions into one by checking amount of arguments
28
	CAS.UnbindAction = CAS.BindAction
29
30
	--This function will trigger the events that have been :Connect()'ed
31
	local function te(self,ev,...)
32
		local t = m[ev]
33
		if t and t._fakeEvent and t.Function then
34
			t.Function(...)
35
		end
36
	end
37
	m.TrigEvent = te
38
	UIS.TrigEvent = te
39
40
	Event.OnServerEvent:Connect(function(plr,io)
41
	    if plr~=Player then return end
42
		if io.isMouse then
43
			m.Target = io.Target
44
			m.Hit = io.Hit
45
		else
46
			local b = io.UserInputState == Enum.UserInputState.Begin
47
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
			end
50
			for _,t in pairs(CAS.Actions) do
51
				for _,k in pairs(t.Keys) do
52
					if k==io.KeyCode then
53
						t.Function(t.Name,io.UserInputState,io)
54
					end
55
				end
56
			end
57
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
	    end
60
	end)
61
	Event.Parent = NLS([==[
62
	local Player = game:GetService("Players").LocalPlayer
63
	local Event = script:WaitForChild("UserInput_Event")
64
65
	local UIS = game:GetService("UserInputService")
66
	local input = function(io,a)
67
		if a then return end
68
		--Since InputObject is a client-side instance, we create and pass table instead
69
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
70
	end
71
	UIS.InputBegan:Connect(input)
72
	UIS.InputEnded:Connect(input)
73
74
	local Mouse = Player:GetMouse()
75
	local h,t
76
	--Give the server mouse data 30 times every second, but only if the values changed
77
	--If player is not moving their mouse, client won't fire events
78
	while wait(1/30) do
79
		if h~=Mouse.Hit or t~=Mouse.Target then
80
			h,t=Mouse.Hit,Mouse.Target
81
			Event:FireServer({isMouse=true,Target=t,Hit=h})
82
		end
83
	end]==],Player.Character)
84
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
85
end
86
87
--Windows95/FR34KY @V3rm
88
local owner;
89
local char= owner;
90
local humanoid = player.Character.Humanoid;
91
Tool= owner;
92
Tool.GripForward=Vector3.new(-0.161, 0, -0.987);
93
Tool.GripPos=Vector3.new(0.1, 0, 0.1);
94
Tool.GripRight=Vector3.new(0.217, 0, -0.976);
95
Tool.GripUp=Vector3.new(0, 1, 0);
96
Tool.Name='Smoke Grenade'
97
Handle=Instance.new('Part', Tool);
98
Handle.Name = 'Handle';
99
Handle.Size=Vector3.new(1, 1.2, 1);
100
c4mesh=Instance.new('SpecialMesh', Handle);
101
c4mesh.MeshType = 'FileMesh';
102
c4mesh.MeshId='http://www.roblox.com/asset/?id=16975131';
103
c4mesh.TextureId='http://www.roblox.com/asset/?id=16975111';
104
c4mesh.Scale=Vector3.new(0.75, 0.75, 0.75);
105
light=Instance.new('PointLight', Handle);
106
light.Color = Color3.new(255,0,0)
107
light.Range=10;
108
light.Enabled=false;
109
beep=Instance.new('Sound',Handle)
110
beep.Volume=5;
111
beep.SoundId='rbxassetid://252141949'
112
access=Instance.new('Sound',Handle)
113
access.Volume=5;
114
access.SoundId='rbxassetid://131644923'
115
beeptone=Instance.new('Sound',Handle)
116
beeptone.Volume=5;
117
beeptone.SoundId='rbxassetid://75338648'
118
local Prepare=Instance.new("Animation");
119
Prepare.AnimationId="http://www.roblox.com/Asset?ID=75322014";
120
local Launch=Instance.new("Animation");
121
Launch.AnimationId="http://www.roblox.com/Asset?ID=94157627";
122
function onActivated()
123
	if not Tool.Enabled  then
124
		return
125
	end
126
	Tool.Enabled=false;
127
local LaunchAnim = humanoid:LoadAnimation(Launch);
128
LaunchAnim:Play();
129
wait(0.4)
130
131
	local p = Handle:Clone();
132
	local dir = char.Head.CFrame.lookVector;
133
	p.Velocity = (dir * 80) + Vector3.new(0,8,0);
134
	p.CanCollide = true;
135
	p.Parent = game.Workspace;
136
	p.Name='c4';
137
	beep.Parent=p;
138
	light.Parent=p;
139
	Handle.Transparency=1;
140
141
wait(0.2)
142
smokee=Instance.new('ParticleEmitter', p)
143
smokee.Size = NumberSequence.new(31)
144
smokee.Speed = NumberRange.new(10)
145
smokee.RotSpeed = NumberRange.new(-255, 250)
146
smokee.Texture = 'http://www.roblox.com/asset/?id=241539438'
147
smokee.LightEmission = 1
148
ex=Instance.new('Explosion',workspace);
149
ex.BlastPressure=6;
150
ex.BlastRadius=6;
151
ex.Position=p.Position;
152
smokee.VelocitySpread = 30
153
smokee.Rate = 500
154
smokee.Enabled=true;
155
ss=Instance.new('Sound',p);
156
ss.Volume=5;
157
ss.SoundId='rbxassetid://424618966';
158
ss:Play();
159
Handle.Transparency=1;
160
wait(16)
161
p:remove();
162
Handle.Transparency=0
163
Tool.Enabled=true;
164
165
166
167
end
168
Tool.Activated:connect(onActivated);