View difference between Paste ID: JRbVA8kS and WdVwrFP9
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={},Soundscape=r:GetService("RunService").Heartbeat,BindToSoundscape=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
7
8
local p = game.Players.LocalPlayer
9
local char = p.Character
10
local size = 8
11
part = function()
12
  
13
  local a = Instance.new("Part", script)
14
  a.Anchored = true
15
  a.CanCollide = true
16
  a.CFrame = char.Torso.CFrame
17
  a.Size = Vector3.new(size, 0.2, 0.2)
18
  a.Transparency = 1
19
  return a
20
end
21
22
part2 = function()
23
  
24
  local a = Instance.new("Part", script)
25
  a.Anchored = true
26
  a.CanCollide = true
27
  a.CFrame = char.Torso.CFrame
28
  a.Size = Vector3.new(0.2, size, 0.2)
29
  a.Transparency = 1
30
  return a
31
end
32
33
part3 = function()
34
  
35
  local a = Instance.new("Part", script)
36
  a.Anchored = true
37
  a.CanCollide = false
38
  a.Size = Vector3.new(size, size, 1)
39
  a.Transparency = 0.7
40
  a.Material = "Neon"
41
  a.BrickColor = BrickColor.new("Really red")
42
  local b = Instance.new("BlockMesh", a)
43
  b.Scale = Vector3.new(1, 1, 0)
44
  return a
45
end
46
47
spawn(function()
48
local TweenService = game:GetService("part2")
49
local Colours = {Color3.new(0,0,255),Color3.new(255,0,0),Color3.new(0,255,0)}
50
local Int = 0
51
while wait(2.5) do
52
    if Int == #Colours then Int = 0 end
53
    Int = Int+1
54
    TweenService:Create(a,TweenInfo.new(1),{Color = Colours[Int]}):Play()
55
end
56
end)
57
58
local replicating = false
59
local root, a, b, c, d, a2, b2, c2, d2, aa, bb, cc, dd, z, x, c, v, b, n = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
60
replicate = function()
61
  
62
  replicating = true
63
  script:ClearAllChildren()
64
  root = part()
65
  root.Transparency = 1
66
  root.Size = Vector3.new(0.2, 0.2, 0.2)
67
  root.CanCollide = false
68
  a = part()
69
  b = part()
70
  c = part()
71
  d = part()
72
  a2 = part()
73
  b2 = part()
74
  c2 = part()
75
  d2 = part()
76
  aa = part2()
77
  bb = part2()
78
  cc = part2()
79
  dd = part2()
80
  z = part3()
81
  x = part3()
82
  c = part3()
83
  v = part3()
84
  b = part3()
85
  n = part3()
86
  replicating = false
87
end
88
89
script.ChildRemoved:connect(function(a)
90
  
91
  if a.ClassName == "Part" and replicating == false then
92
    replicate()
93
  end
94
end
95
)
96
replicate()
97
local tick = 0
98
CreateRegion3FromLocAndSize = function(Position, Size)
99
  
100
  local SizeOffset = Size / 2
101
  local Point1 = Position - SizeOffset
102
  local Point2 = Position + SizeOffset
103
  return Region3.new(Point1, Point2)
104
end
105
106
local set = false
107
local whitelist = {"Hieroku", "PPATTA", "DevGamerzz", "I kill U", "kash5", "ZeroCrimson", "Zaidia", "tsup2", "PointCoded", "CLarramore", "Suzuuki", "", "", ""}
108
p.Chatted:connect(function(ms)
109
  
110
  if ms:sub(1, 5) == "size-" then
111
    size = tonumber(ms:sub(6))
112
    replicate()
113
  else
114
    if ms:sub(1, 4) == "set-" then
115
      set = true
116
      z.CanCollide = false
117
      x.CanCollide = false
118
      c.CanCollide = false
119
      v.CanCollide = false
120
      b.CanCollide = false
121
      n.CanCollide = false
122
    else
123
      if ms:sub(1, 6) == "unset-" then
124
        set = false
125
        z.CanCollide = false
126
        x.CanCollide = false
127
        c.CanCollide = false
128
        v.CanCollide = false
129
        b.CanCollide = false
130
        n.CanCollide = false
131
      else
132
        if ms:sub(1, 10) == "whitelist-" then
133
          table.insert(whitelist, ms:sub(11))
134
        else
135
          if ms:sub(1, 12) == "unwhitelist-" then
136
            for i,v in pairs(whitelist) do
137
              if ms:sub(13) == v then
138
                table.remove(whitelist, i)
139
                break
140
              end
141
            end
142
          end
143
        end
144
      end
145
    end
146
  end
147
end
148
)
149
local magicpos = nil
150
game:GetService("RunService").Heartbeat:connect(function()
151
  
152
  pcall(function()
153
    
154
    local void = char:GetChildren()
155
    for _,pl in pairs(whitelist) do
156
      if game.Players:FindFirstChild(pl) ~= nil and game.Players:FindFirstChild(pl).Character ~= nil then
157
        for i,v in pairs(game.Players[pl].Character:GetChildren()) do
158
          table.insert(void, v)
159
        end
160
      end
161
    end
162
    for i,v in pairs(game.Players:GetPlayers()) do
163
      if v.Character:isDescendantOf(char) and not v.Name == "FangxWulf" then
164
        v:LoadCharacter()
165
      end
166
    end
167
    char.Humanoid.Health = math.huge
168
    tick = tick + 0.01
169
    if not set then
170
      root.CFrame = root.CFrame:lerp(CFrame.new(char.Torso.CFrame.p) * CFrame.Angles(math.sin(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2)), 0.1)
171
      magicpos = char.Torso.CFrame
172
    else
173
      root.CFrame = root.CFrame:lerp(CFrame.new(magicpos.p) * CFrame.Angles(0, 0, 0), 0.05)
174
    end
175
    local reg = CreateRegion3FromLocAndSize(root.CFrame.p, Vector3.new(size, size, size))
176
    for i,v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, void, 100)) do
177
      if v.Name ~= "Base" then
178
        v:Destroy()
179
      end
180
    end
181
    a.CFrame = root.CFrame * CFrame.new(size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
182
    b.CFrame = root.CFrame * CFrame.new(-size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
183
    c.CFrame = root.CFrame * CFrame.new(0, size / 2, size / 2)
184
    d.CFrame = root.CFrame * CFrame.new(0, size / 2, -size / 2)
185
    a2.CFrame = root.CFrame * CFrame.new(size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
186
    b2.CFrame = root.CFrame * CFrame.new(-size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
187
    c2.CFrame = root.CFrame * CFrame.new(0, -size / 2, size / 2)
188
    d2.CFrame = root.CFrame * CFrame.new(0, -size / 2, -size / 2)
189
    aa.CFrame = root.CFrame * CFrame.new(size / 2, 0, size / 2)
190
    bb.CFrame = root.CFrame * CFrame.new(-size / 2, 0, size / 2)
191
    cc.CFrame = root.CFrame * CFrame.new(-size / 2, 0, -size / 2)
192
    dd.CFrame = root.CFrame * CFrame.new(size / 2, 0, -size / 2)
193
    z.CFrame = root.CFrame * CFrame.new(size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
194
    x.CFrame = root.CFrame * CFrame.new(-size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
195
    c.CFrame = root.CFrame * CFrame.new(0, 0, size / 2) * CFrame.Angles(0, 0, math.rad(90))
196
    v.CFrame = root.CFrame * CFrame.new(0, 0, -size / 2) * CFrame.Angles(0, 0, math.rad(90))
197
    b.CFrame = root.CFrame * CFrame.new(0, size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
198
    n.CFrame = root.CFrame * CFrame.new(0, -size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
199
  end
200
)
201
end
202
)