SHOW:
|
|
- or go back to the newest paste.
1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
3 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
4 | local RealPlayer = Player | |
5 | do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end | |
6 | local Me = game:GetService("Players").LocalPlayer | |
7 | local Char = Me.Character | |
8 | local Torso = Char.Torso | |
9 | local TickWait = 1 | |
10 | local Color = "Medium stone gray" | |
11 | local Dead = false | |
12 | ||
13 | local Tool = Instance.new("HopperBin", Me.Backpack) | |
14 | Tool.Name = "Bomb Vest" | |
15 | ||
16 | local Position = Vector3.new(0,100,0) | |
17 | function NewPart(Parent) | |
18 | local Part = Instance.new("Part", Parent) | |
19 | Part.CanCollide = false | |
20 | Part.FormFactor = "Custom" | |
21 | Part.Position = Position | |
22 | Part.TopSurface = "Smooth" | |
23 | Part.BottomSurface = "Smooth" | |
24 | Part.BrickColor = BrickColor.new(Color) | |
25 | Position = Position + Vector3.new(0,Part.Size.Y + 10,0) | |
26 | return Part | |
27 | end | |
28 | ||
29 | local Model = Char:FindFirstChild("Bomb") | |
30 | if Model then Model:Destroy() end | |
31 | ||
32 | Model = Instance.new("Model", Char) | |
33 | Model.Name = "Bomb" | |
34 | ||
35 | local Belt = NewPart(Model) | |
36 | Belt.Size = Vector3.new(2.2,0.5,1.2) | |
37 | local Weld = Instance.new("Weld", Belt) | |
38 | Weld.Part0 = Belt | |
39 | Weld.Part1 = Torso | |
40 | Weld.C0 = CFrame.new(0,1.1,0) | |
41 | local Light = Instance.new("PointLight", Belt) | |
42 | Light.Range = 15 | |
43 | Light.Brightness = 5 | |
44 | Light.Color = Color3.new(1,0,0) | |
45 | local Beep = Instance.new("Sound", Belt) | |
46 | Beep.SoundId = "http://www.roblox.com/asset/?id=188588790" | |
47 | local ExplodeSound = Instance.new("Sound", Belt) | |
48 | ExplodeSound.SoundId = "http://www.roblox.com/asset/?id="..(tonumber((math.ceil(1776.66^2)+17).."."..string.rep("36",3))*77)+0.00003 --144507765 | |
49 | ExplodeSound.Pitch = 2.8 | |
50 | ExplodeSound.Volume = 3 | |
51 | AKBAR=Instance.new("Sound", Belt) | |
52 | AKBAR.SoundId = 'rbxassetid://396873260' | |
53 | AKBAR.Volume = 15 | |
54 | AKBAR.Pitch = 0.25 | |
55 | ||
56 | local Back = NewPart(Model) | |
57 | Back.Size = Vector3.new(1.5,1.5,0.5) | |
58 | local Weld = Instance.new("Weld", Back) | |
59 | Weld.Part0 = Back | |
60 | Weld.Part1 = Torso | |
61 | Weld.C0 = CFrame.new(0,0.1,-0.75) | |
62 | ||
63 | local StrapLeft = NewPart(Model) | |
64 | StrapLeft.Size = Vector3.new(0.2,0.5,1.6) | |
65 | local Weld = Instance.new("Weld", StrapLeft) | |
66 | Weld.Part0 = StrapLeft | |
67 | Weld.Part1 = Torso | |
68 | Weld.C0 = CFrame.new(0.65,-0.9,-0.2) | |
69 | ||
70 | local BuckleLeft = NewPart(Model) | |
71 | BuckleLeft.Size = Vector3.new(0.2,1.5,0.2) | |
72 | local Weld = Instance.new("Weld", BuckleLeft) | |
73 | Weld.Part0 = BuckleLeft | |
74 | Weld.Part1 = Torso | |
75 | Weld.C0 = CFrame.new(0.65,0.1,0.5) | |
76 | ||
77 | local StrapRight = NewPart(Model) | |
78 | StrapRight.Size = Vector3.new(0.2,0.5,1.6) | |
79 | local Weld = Instance.new("Weld", StrapRight) | |
80 | Weld.Part0 = StrapRight | |
81 | Weld.Part1 = Torso | |
82 | Weld.C0 = CFrame.new(-0.65,-0.9,-0.2) | |
83 | ||
84 | local BuckleRight = NewPart(Model) | |
85 | BuckleRight.Size = Vector3.new(0.2,1.5,0.2) | |
86 | local Weld = Instance.new("Weld", BuckleRight) | |
87 | Weld.Part0 = BuckleRight | |
88 | Weld.Part1 = Torso | |
89 | Weld.C0 = CFrame.new(-0.65,0.1,0.5) | |
90 | ||
91 | Tool.Selected:connect(function(Mouse) | |
92 | TickWait = 0.3 | |
93 | Mouse.Icon = "http://www.roblox.com/asset/?id=9109985" | |
94 | ||
95 | Mouse.Button1Down:connect(function() | |
96 | if Dead == false then | |
97 | Dead = true | |
98 | AKBAR:Play() | |
99 | wait(.6) | |
100 | ExplodeSound:Play() | |
101 | wait(1.4) | |
102 | local Explosion = Instance.new("Explosion", Workspace) | |
103 | Explosion.Position = Belt.Position | |
104 | Explosion.BlastPressure = 100000 | |
105 | Explosion.DestroyJointRadiusPercent = 0.7 | |
106 | Explosion.ExplosionType = "CratersAndDebris" | |
107 | Explosion.BlastRadius = 50 | |
108 | Explosion.Hit:connect(function(Part, Distance) | |
109 | Part.Anchored = false | |
110 | if Distance <= 10 then | |
111 | Part:BreakJoints() | |
112 | end | |
113 | end) | |
114 | end | |
115 | end) | |
116 | end) | |
117 | ||
118 | Tool.Deselected:connect(function() | |
119 | TickWait = 1 | |
120 | end) | |
121 | ||
122 | coroutine.wrap(function() | |
123 | repeat | |
124 | wait(TickWait) | |
125 | Light.Enabled = not Light.Enabled | |
126 | Beep:Play() | |
127 | until Dead == true | |
128 | end)() |