View difference between Paste ID: F3hFX866 and ENQ5Dr03
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
print(" this script was converted by An Idiotic converter ( zach ) ")
3
warn(" credits goes to the real creator ")
4
warn(" pls dont abuse ")
5
warn(" i beg u ")
6
local Player,game,owner = owner,game
7
local RealPlayer = Player
8
do
9
    print("FE Compatibility code by Mokiros")
10
    print(" Ultimate Non realistic finger gun :D ")
11
    local rp = RealPlayer
12
    script.Parent = rp.Character
13
   
14
    --RemoteEvent for communicating
15
    local Event = Instance.new("RemoteEvent")
16
    Event.Name = "UserInput_Event"
17
 
18
    --Fake event to make stuff like Mouse.KeyDown work
19
    local function fakeEvent()
20
        local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
21
        t.connect = t.Connect
22
        return t
23
    end
24
 
25
    --Creating fake input objects with fake variables
26
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
27
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
28
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
29
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
30
    end}
31
    --Merged 2 functions into one by checking amount of arguments
32
    CAS.UnbindAction = CAS.BindAction
33
 
34
    --This function will trigger the events that have been :Connect()'ed
35
    local function te(self,ev,...)
36
        local t = m[ev]
37
        if t and t._fakeEvent then
38
            for _,f in pairs(t.Functions) do
39
                f(...)
40
            end
41
        end
42
    end
43
    m.TrigEvent = te
44
    UIS.TrigEvent = te
45
 
46
    Event.OnServerEvent:Connect(function(plr,io)
47
        if plr~=rp then return end
48
        m.Target = io.Target
49
        m.Hit = io.Hit
50
        if not io.isMouse then
51
            local b = io.UserInputState == Enum.UserInputState.Begin
52
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
53
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
54
            end
55
            for _,t in pairs(CAS.Actions) do
56
                for _,k in pairs(t.Keys) do
57
                    if k==io.KeyCode then
58
                        t.Function(t.Name,io.UserInputState,io)
59
                    end
60
                end
61
            end
62
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
63
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
64
        end
65
    end)
66
    Event.Parent = NLS([==[
67
    local Player = game:GetService("Players").LocalPlayer
68
    local Event = script:WaitForChild("UserInput_Event")
69
 
70
    local Mouse = Player:GetMouse()
71
    local UIS = game:GetService("UserInputService")
72
    local input = function(io,a)
73
        if a then return end
74
        --Since InputObject is a client-side instance, we create and pass table instead
75
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
76
    end
77
    UIS.InputBegan:Connect(input)
78
    UIS.InputEnded:Connect(input)
79
 
80
    local h,t
81
    --Give the server mouse data 30 times every second, but only if the values changed
82
    --If player is not moving their mouse, client won't fire events
83
    while wait(1/30) do
84
        if h~=Mouse.Hit or t~=Mouse.Target then
85
            h,t=Mouse.Hit,Mouse.Target
86
            Event:FireServer({isMouse=true,Target=t,Hit=h})
87
        end
88
    end]==],Player.Character)
89
 
90
    ----Sandboxed game object that allows the usage of client-side methods and services
91
    --Real game object
92
    local _rg = game
93
 
94
    --Metatable for fake service
95
    local fsmt = {
96
        __index = function(self,k)
97
            local s = rawget(self,"_RealService")
98
            if s then return s[k] end
99
        end,
100
        __newindex = function(self,k,v)
101-
		bullet.Color = Color3.fromRGB(200, 76, 200)
101+
            local s = rawget(self,"_RealService")
102
            if s then s[k]=v end
103
        end,
104
        __call = function(self,...)
105
            local s = rawget(self,"_RealService")
106
            if s then return s(...) end
107
        end
108
    }
109
    local function FakeService(t,RealService)
110
        t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
111
        return setmetatable(t,fsmt)
112
    end
113
 
114
    --Fake game object
115
    local g = {
116
        GetService = function(self,s)
117
            return self[s]
118
        end,
119
        Players = FakeService({
120
            LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
121
        },"Players"),
122
        UserInputService = FakeService(UIS,"UserInputService"),
123
        ContextActionService = FakeService(CAS,"ContextActionService"),
124
    }
125
    rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
126
    g.service = g.GetService
127
   
128
    g.RunService = FakeService({
129
        RenderStepped = _rg:GetService("RunService").Heartbeat,
130
        BindToRenderStep = function(self,name,_,fun)
131
 
132
        end,
133
        UnbindFromRenderStep = function(self,name)
134
            self._btrs[name]:Disconnect()
135
        end,
136
    },"RunService")
137
 
138
    setmetatable(g,{
139
        __index=function(self,s)
140
            return _rg:GetService(s) or typeof(_rg[s])=="function"
141
            and function(_,...)return _rg[s](_rg,...)end or _rg[s]
142
        end,
143
        __newindex = fsmt.__newindex,
144
        __call = fsmt.__call
145
    })
146
    --Changing owner to fake player object to support owner:GetMouse()
147
    game,owner = g,g.Players.LocalPlayer
148
end
149
150
151
local plr = game:service'Players'.LocalPlayer
152
local chr = plr.Character
153
local hum = chr.Humanoid
154
local rarm = chr["Right Arm"]
155
local larm= chr["Left Arm"]
156
local rleg= chr["Right Leg"]
157
local lleg = chr["Left Leg"]
158
local root = chr.HumanoidRootPart
159
local tors = chr.Torso
160
local head = chr.Head
161
local RunS = game:GetService("RunService")
162
local mouse = plr:GetMouse()
163
local RenderS = RunS.RenderStepped
164
local t = tick()
165
local defAnim = true
166
local action = ''
167
local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
168
local V3 = {N=Vector3.new}
169
local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge}
170
local Effects,Sounds = {},{};
171
172
173
Sounds['Wet'] = {Id=256738023,Loop=false,Pitch=1}
174
Sounds['Swoosh1'] = {Id=320557353,Loop=false,Pitch=1}
175
Sounds['Swoosh2'] = {Id=320557382,Loop=false,Pitch=1}
176
Sounds['Swoosh3'] = {Id=320557413,Loop=false,Pitch=1}
177
Sounds['Swoosh4'] = {Id=320557453,Loop=false,Pitch=1}
178
Sounds['Swoosh5'] = {Id=320557487,Loop=false,Pitch=1}
179
Sounds['Swoosh6'] = {Id=320557537,Loop=false,Pitch=1}
180
Sounds['Swoosh7'] = {Id=320557563,Loop=false,Pitch=1}
181
Sounds['Swoosh8'] = {Id=320557518,Loop=false,Pitch=1}
182
Sounds['ShrekRemix'] = {Id=163306929,Loop=true,Pitch=1,Volume = 4}
183
Sounds['CreoDimension'] = {Id=927529620,Loop=true,Pitch=1,Volume=4}
184
Sounds['BlackBlizzard'] = {Id=657626121,Loop=true,Pitch=1,Volume=4}
185
Sounds['ColbreakzFantasy'] = {Id=876981900,Loop=true,Pitch=1,Volume=4}
186
Sounds['NeflCrystals'] = {Id=340106355,Loop=true,Pitch=1,Volume=4}
187
Sounds['EvilMortyRemix'] = {Id=1057401232,Loop=true,Pitch=1,Volume=10}
188
189
local NewInstance = function(instance,parent,properties)
190
	local inst = Instance.new(instance,parent)
191
	if properties then
192
		for i,v in next, properties do
193
			pcall(function() inst[i] = v end)
194
		end
195
	end
196
	return inst;
197
end
198
local sndFromData = function(data,parent)
199
	if typeof(data) == 'table' then
200
		local snd = NewInstance("Sound",parent or chr,{SoundId = "rbxassetid://"..data.Id,Looped=data.Loop or false,Pitch = data.Pitch or 1,Volume = data.Volume or 1})
201
		return snd;
202
	else
203
		return error('Argument passed into sndFromData must be a table!',1)
204
	end
205
end
206
207
New = function(Object, Parent, Name, Data)
208
	local Object = Instance.new(Object)
209
	for Index, Value in pairs(Data or {}) do
210
		Object[Index] = Value
211
	end
212
	Object.Parent = Parent
213
	Object.Name = Name
214
	return Object
215
end
216
217
-- Build
218
fongr = New("Part",larm,"fongr",{BrickColor = (chr:FindFirstChildOfClass"Body Colors" and chr:FindFirstChildOfClass"Body Colors".LeftArmColor or larm.BrickColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(0.193568379, 1.20012438, 0.193568379),CFrame = CFrame.new(12.9260693, 1.73919964, -21.1709423, -1, 0, 0, 0, 1, 0, 0, 0, -1),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(1, 0.8, 0.6),})
219
mot = New("Motor",fongr,"mot",{Part0 = fongr,Part1 = larm,C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),C1 = CFrame.new(-0.301872253, -1.24136782, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),})
220
fongr = New("Part",larm,"fongr",{BrickColor = (chr:FindFirstChildOfClass"Body Colors" and chr:FindFirstChildOfClass"Body Colors".LeftArmColor or larm.BrickColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(0.193568379, 0.688505769, 0.193568379),CFrame = CFrame.new(13.2772827, 2.0387857, -21.1709423, 0.0177989937, -0.99984163, 0, -0.99984163, -0.0177989937, 0, -0, 0, -1),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(1, 0.8, 0.6),})
221
mot = New("Motor",fongr,"mot",{Part0 = fongr,Part1 = larm,C0 = CFrame.new(0, 0, 0, 0.0177989937, -0.99984163, 0, -0.99984163, -0.0177989937, 0, 0, 0, -1),C1 = CFrame.new(-0.653085709, -0.941781759, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),})
222
fongr = New("Part",larm,"fongr",{BrickColor = (chr:FindFirstChildOfClass"Body Colors" and chr:FindFirstChildOfClass"Body Colors".LeftArmColor or larm.BrickColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(0.193568379, 1.20012438, 0.193568379),CFrame = CFrame.new(12.7063389, 1.73919964, -21.1709423, -1, 0, 0, 0, 1, 0, 0, 0, -1),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(1, 0.8, 0.6),})
223
mot = New("Motor",fongr,"mot",{Part0 = fongr,Part1 = larm,C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),C1 = CFrame.new(-0.0821418762, -1.24136782, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),})
224
225
-- Joints
226
local LS = NewInstance('Weld',tors,{Part0=tors,Part1=larm,C0 = CF.N(-1.5,0.5,0),C1 = CF.N(0,.5,0)})
227
local RS = NewInstance('Weld',tors,{Part0=tors,Part1=rarm,C0 = CF.N(1.5,0.5,0),C1 = CF.N(0,.5,0)})
228
local NK = NewInstance('Weld',tors,{Part0=tors,Part1=head,C0 = CF.N(0,1.5,0)})
229
local LH = NewInstance('Weld',tors,{Part0=tors,Part1=lleg,C0 = CF.N(-.5,-1,0),C1 = CF.N(0,1,0)})
230
local RH = NewInstance('Weld',tors,{Part0=tors,Part1=rleg,C0 = CF.N(.5,-1,0),C1 = CF.N(0,1,0)})
231
local RJ = NewInstance('Weld',tors,{Part0=tors,Part1=root})
232
233
234
-- Default C0s
235
local LSD=LS.C0
236
local RSD=RS.C0
237
local HD=NK.C0
238
local TD=RJ.C0
239
local LHD=LH.C0
240
local RHD=RH.C0
241
local holding = false
242
function shot()
243
	if(holding)then
244
		local bullet = Instance.new('Part',chr)
245
		bullet.CFrame = CF.N(larm.CFrame.p,mouse.Hit.p)
246
		bullet.FormFactor = "Custom"
247
		bullet.Size = Vector3.new(1,1,1)
248
		bullet.CanCollide = false
249
		bullet.Transparency = 0.25
250
		bullet.Shape = 'Ball'
251
		bullet.Color = Color3.fromRGB(0, 0, 200)
252
		local bodyVelocity = Instance.new('BodyVelocity',bullet)
253
		bodyVelocity.velocity = (mouse.Hit.p - larm.CFrame.p).unit * 75
254
		delay(.2, function()
255
			bodyVelocity:destroy()
256
		end)
257
		bullet.Touched:connect(function(o)
258
			if o.Parent ~= chr and o.Parent.Parent ~= chr then
259
				local h = o.Parent:FindFirstChildOfClass'Humanoid'
260
				if h then
261
					h.Health = h.Health - h.MaxHealth/4
262
				end
263
				bullet:destroy()
264
			end
265
		end)
266
	end
267
end
268
269
mouse.Button1Down:connect(function()
270
	defAnim = false;
271
	holding = true;
272
	repeat wait(.3) action = 'Attackie1' shot()  wait(.15) action = 'Attackie2' until holding == false
273
	defAnim = true;
274
end)
275
mouse.Button1Up:connect(function()
276
	holding = false;
277
end)
278
local c = 0.5;
279
280
--hum.AutoRotate = false;
281
local stance = 'Idle'
282
RenderS:connect(function()
283
	t = t + c
284
	--mouse.TargetFilter = workspace;
285
	--tors.CFrame = CFrame.new(tors.Position, Vector3.new(mouse.Hit.p.X, 0, mouse.Hit.p.Z))
286
	if math.abs(root.Velocity.x) > 2 or math.abs(root.Velocity.z) > 2 and hum:GetState() ~= Enum.HumanoidStateType.Freefall then
287
		stance = "Walk"
288
	elseif math.abs(root.Velocity.x) < 2 or math.abs(root.Velocity.z) < 2 then
289
		stance = "Idle"
290
	end
291
	if defAnim then
292
		if(stance == "Walk")then
293
			RJ.C0 = RJ.C0:lerp(CF.N(0,0,0)*CF.A(M.R(-4+2*M.C(t/7)),0,0),.3)
294
			--RJ.C0 = RJ.C0:lerp(CF.N(0,0,0),.3)
295
			NK.C0 = NK.C0:lerp(CF.N(0,1.5,0),.3)
296
			RH.C0 = RH.C0:lerp(CF.N(.5,-1+.45*M.C(t/12)/4,.05+-M.S(t/12)/4)*CF.A(M.R(-12)+M.S(t/12)/2.3,0,0),.3)
297
			LH.C0 = LH.C0:lerp(CF.N(-.5,-1-.45*M.C(t/12)/4,.05+M.S(t/12)/4)*CF.A(M.R(-12)+-M.S(t/12)/2.3,0,0),.3)
298
			RS.C0 = RS.C0:lerp(CF.N(1.5,.5,-M.S(t/14)/4)*CF.A(M.S(t/14)/4,0,0),.3)
299
			LS.C0 = LS.C0:lerp(CFrame.new(-1.51529181, 0.407044411, 0.0411384404, -1.25390983e-07, 1.78837407e-08, -1.00000036, -0.989982247, 0.141195044, 1.2665987e-07, 0.141195014, 0.989981771, 0),0.1)
300
			c = 1				
301
		else
302
			LS.C0 = LS.C0:lerp(CFrame.new(-1.51529181, 0.407044411, 0.0411384404, -1.25390983e-07, 1.78837407e-08, -1.00000036, -0.989982247, 0.141195044, 1.2665987e-07, 0.141195014, 0.989981771, 0),0.1)
303
			RJ.C0 = RJ.C0:lerp(CFrame.new(0, 0, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
304
			LH.C0 = LH.C0:lerp(CFrame.new(-0.440940678, -0.992188036, 0.0145819485, 0.998181283, 0.0590542518, 0.012143841, -0.0602898225, 0.97772485, 0.201056987, -5.22762598e-08, -0.201423571, 0.979505241),0.1)
305
			NK.C0 = NK.C0:lerp(CFrame.new(7.62939999e-06, 1.49997056, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
306
			RH.C0 = RH.C0:lerp(CFrame.new(0.4349491, -0.970435679, -0.0502791964, 0.99788934, -0.0649418086, 0.000381366728, 0.0649427921, 0.997872889, -0.00586463744, 3.0428501e-07, 0.00587702403, 0.999982953),0.1)
307
			RS.C0 = RS.C0:lerp(CFrame.new(1.44655097, 0.506112933, 0.0941094309, 0.994473815, -0.104665354, -0.00821636897, 0.104987323, 0.991423786, 0.0778287426, -6.72606149e-08, -0.0782612264, 0.996932983),0.1)
308
			c = 0.5
309
		end
310
	else
311
		if(action == "Attackie1")then
312
			if(stance == 'Walk') then
313
				c = 1;
314
				RJ.C0 = RJ.C0:lerp(CF.N(0,0,0)*CF.A(M.R(-4+2*M.C(t/7)),0,0),.3)
315
				--RJ.C0 = RJ.C0:lerp(CF.N(0,0,0),.3)
316
				NK.C0 = NK.C0:lerp(CF.N(0,1.5,0),.3)
317
				RH.C0 = RH.C0:lerp(CF.N(.5,-1+.45*M.C(t/12)/4,.05+-M.S(t/12)/4)*CF.A(M.R(-12)+M.S(t/12)/2.3,0,0),.3)
318
				LH.C0 = LH.C0:lerp(CF.N(-.5,-1-.45*M.C(t/12)/4,.05+M.S(t/12)/4)*CF.A(M.R(-12)+-M.S(t/12)/2.3,0,0),.3)
319
				RS.C0 = RS.C0:lerp(CF.N(1.5,.5,-M.S(t/14)/4)*CF.A(M.S(t/14)/4,0,0),.3)
320
			else
321
				c = 0.5;
322
				RJ.C0 = RJ.C0:lerp(CFrame.new(0, 0, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
323
				LH.C0 = LH.C0:lerp(CFrame.new(-0.440940678, -0.992188036, 0.0145819485, 0.998181283, 0.0590542518, 0.012143841, -0.0602898225, 0.97772485, 0.201056987, -5.22762598e-08, -0.201423571, 0.979505241),0.1)
324
				NK.C0 = NK.C0:lerp(CFrame.new(7.62939999e-06, 1.49997056, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
325
				RH.C0 = RH.C0:lerp(CFrame.new(0.4349491, -0.970435679, -0.0502791964, 0.99788934, -0.0649418086, 0.000381366728, 0.0649427921, 0.997872889, -0.00586463744, 3.0428501e-07, 0.00587702403, 0.999982953),0.1)
326
				RS.C0 = RS.C0:lerp(CFrame.new(1.44655097, 0.506112933, 0.0941094309, 0.994473815, -0.104665354, -0.00821636897, 0.104987323, 0.991423786, 0.0778287426, -6.72606149e-08, -0.0782612264, 0.996932983),0.1)
327
			end
328
			LS.C0 = LS.C0:lerp(CFrame.new(-1.51529181, 0.407044411, 0.0411384404, -1.25390983e-07, 1.78837407e-08, -1.00000036, -0.989982247, 0.141195044, 1.2665987e-07, 0.141195014, 0.989981771, 0)*CF.A(0,0,M.R(-25)),0.1)
329
		elseif(action == "Attackie2")then
330
			if(stance == 'Walk') then
331
				c = 1;
332
				RJ.C0 = RJ.C0:lerp(CF.N(0,0,0)*CF.A(M.R(-4+2*M.C(t/7)),0,0),.3)
333
				--RJ.C0 = RJ.C0:lerp(CF.N(0,0,0),.3)
334
				NK.C0 = NK.C0:lerp(CF.N(0,1.5,0),.3)
335
				RH.C0 = RH.C0:lerp(CF.N(.5,-1+.45*M.C(t/12)/4,.05+-M.S(t/12)/4)*CF.A(M.R(-12)+M.S(t/12)/2.3,0,0),.3)
336
				LH.C0 = LH.C0:lerp(CF.N(-.5,-1-.45*M.C(t/12)/4,.05+M.S(t/12)/4)*CF.A(M.R(-12)+-M.S(t/12)/2.3,0,0),.3)
337
				RS.C0 = RS.C0:lerp(CF.N(1.5,.5,-M.S(t/14)/4)*CF.A(M.S(t/14)/4,0,0),.3)
338
			else
339
				c = 0.5;
340
				RJ.C0 = RJ.C0:lerp(CFrame.new(0, 0, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
341
				LH.C0 = LH.C0:lerp(CFrame.new(-0.440940678, -0.992188036, 0.0145819485, 0.998181283, 0.0590542518, 0.012143841, -0.0602898225, 0.97772485, 0.201056987, -5.22762598e-08, -0.201423571, 0.979505241),0.1)
342
				NK.C0 = NK.C0:lerp(CFrame.new(7.62939999e-06, 1.49997056, 0, 1.00000072, 0, 0, 0, 1.00000072, 0, 0, 0, 1),0.1)
343
				RH.C0 = RH.C0:lerp(CFrame.new(0.4349491, -0.970435679, -0.0502791964, 0.99788934, -0.0649418086, 0.000381366728, 0.0649427921, 0.997872889, -0.00586463744, 3.0428501e-07, 0.00587702403, 0.999982953),0.1)
344
				RS.C0 = RS.C0:lerp(CFrame.new(1.44655097, 0.506112933, 0.0941094309, 0.994473815, -0.104665354, -0.00821636897, 0.104987323, 0.991423786, 0.0778287426, -6.72606149e-08, -0.0782612264, 0.996932983),0.1)
345
			end
346
			LS.C0 = LS.C0:lerp(CFrame.new(-1.51529181, 0.407044411, 0.0411384404, -1.25390983e-07, 1.78837407e-08, -1.00000036, -0.989982247, 0.141195044, 1.2665987e-07, 0.141195014, 0.989981771, 0)*CF.A(0,M.R(0),0),0.1)
347
		
348
		end
349
	end
350
end)