SHOW:
|
|
- or go back to the newest paste.
1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
2 | - | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
2 | + | |
3 | - | do |
3 | + | local Player,game,owner = owner,game |
4 | - | print("FE Compatibility code by Mokiros") |
4 | + | local RealPlayer = Player |
5 | - | script.Parent = Player.Character |
5 | + | do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end plr = game.Players.LocalPlayer |
6 | repeat wait() until plr.Character | |
7 | - | --RemoteEvent for communicating |
7 | + | |
8 | - | local Event = Instance.new("RemoteEvent") |
8 | + | |
9 | - | Event.Name = "UserInput_Event" |
9 | + | |
10 | effect.Name = "Effects" | |
11 | - | --Fake event to make stuff like Mouse.KeyDown work |
11 | + | |
12 | - | local function fakeEvent() |
12 | + | |
13 | - | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} |
13 | + | |
14 | - | t.connect = t.Connect |
14 | + | |
15 | - | return t |
15 | + | |
16 | moozik.Looped = true | |
17 | moozik:Play() | |
18 | - | --Creating fake input objects with fake variables |
18 | + | |
19 | - | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} |
19 | + | |
20 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} |
20 | + | |
21 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) |
21 | + | |
22 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil |
22 | + | |
23 | - | end} |
23 | + | |
24 | - | --Merged 2 functions into one by checking amount of arguments |
24 | + | |
25 | - | CAS.UnbindAction = CAS.BindAction |
25 | + | |
26 | block.Size = Vector3.new(1,1,1) | |
27 | - | --This function will trigger the events that have been :Connect()'ed |
27 | + | |
28 | - | local function te(self,ev,...) |
28 | + | |
29 | - | local t = m[ev] |
29 | + | |
30 | - | if t and t._fakeEvent and t.Function then |
30 | + | |
31 | - | t.Function(...) |
31 | + | |
32 | local decal1 = Instance.new("Decal",block) | |
33 | decal1.Face = "Top" | |
34 | - | m.TrigEvent = te |
34 | + | |
35 | - | UIS.TrigEvent = te |
35 | + | |
36 | local decal3 = Instance.new("Decal",block) | |
37 | - | Event.OnServerEvent:Connect(function(plr,io) |
37 | + | |
38 | - | if plr~=Player then return end |
38 | + | |
39 | - | if io.isMouse then |
39 | + | |
40 | - | m.Target = io.Target |
40 | + | |
41 | - | m.Hit = io.Hit |
41 | + | |
42 | - | else |
42 | + | |
43 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
43 | + | |
44 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
44 | + | |
45 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
45 | + | |
46 | - | end |
46 | + | |
47 | - | for _,t in pairs(CAS.Actions) do |
47 | + | |
48 | - | for _,k in pairs(t.Keys) do |
48 | + | |
49 | - | if k==io.KeyCode then |
49 | + | |
50 | - | t.Function(t.Name,io.UserInputState,io) |
50 | + | |
51 | - | end |
51 | + | |
52 | - | end |
52 | + | |
53 | - | end |
53 | + | |
54 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
54 | + | |
55 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
55 | + | |
56 | - | end |
56 | + | |
57 | - | end) |
57 | + | |
58 | - | Event.Parent = NLS([==[ |
58 | + | |
59 | - | local Player = game:GetService("Players").LocalPlayer |
59 | + | |
60 | - | local Event = script:WaitForChild("UserInput_Event") |
60 | + | |
61 | cp.Size = v.Size+(Vector3.new(1,1,1)*0.2) | |
62 | - | local UIS = game:GetService("UserInputService") |
62 | + | |
63 | - | local input = function(io,a) |
63 | + | |
64 | - | if a then return end |
64 | + | |
65 | - | --Since InputObject is a client-side instance, we create and pass table instead |
65 | + | |
66 | - | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) |
66 | + | |
67 | weld.Part1 = cp | |
68 | - | UIS.InputBegan:Connect(input) |
68 | + | |
69 | - | UIS.InputEnded:Connect(input) |
69 | + | |
70 | end | |
71 | - | local Mouse = Player:GetMouse() |
71 | + | |
72 | - | local h,t |
72 | + | |
73 | - | --Give the server mouse data 30 times every second, but only if the values changed |
73 | + | |
74 | - | --If player is not moving their mouse, client won't fire events |
74 | + | |
75 | - | while wait(1/30) do |
75 | + | |
76 | - | if h~=Mouse.Hit or t~=Mouse.Target then |
76 | + | |
77 | - | h,t=Mouse.Hit,Mouse.Target |
77 | + | |
78 | - | Event:FireServer({isMouse=true,Target=t,Hit=h}) |
78 | + | |
79 | decal6.Texture = right | |
80 | - | end]==],Player.Character) |
80 | + | |
81 | - | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS |
81 | + | |
82 | end | |
83 | function changeblockdecal(whatblock , bottom,top,left,right,back,front) | |
84 | - | plr = owner |
84 | + | |
85 | tex1.Face = "Top" | |
86 | local tex2 = Instance.new("Decal",whatblock) | |
87 | tex2.Face = "Front" | |
88 | local tex3 = Instance.new("Decal",whatblock) | |
89 | tex3.Face = "Bottom" | |
90 | local tex4 = Instance.new("Decal",whatblock) | |
91 | - | print("GET OUT OF MY ROOM I'M PLAYING MINECRAFT!") |
91 | + | |
92 | - | print("By Theamazingnater, now FE!") |
92 | + | |
93 | - | print("Controls: Q to mine, E to change blocks, click to place") |
93 | + | |
94 | local tex6 = Instance.new("Decal",whatblock) | |
95 | tex6.Face = "Right" | |
96 | tex3.Texture = bottom | |
97 | tex1.Texture = top | |
98 | tex5.Texture = left | |
99 | tex6.Texture = right | |
100 | tex4.Texture = back | |
101 | tex2.Texture = front | |
102 | end | |
103 | lhand = char.Torso["Left Shoulder"]:Clone() | |
104 | rhand = char.Torso["Right Shoulder"]:Clone() | |
105 | local rhandweld = Instance.new("Weld",char) | |
106 | rhandweld.Part0 = char.Torso | |
107 | rhandweld.Part1 = char["Right Arm"] | |
108 | rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1) | |
109 | local human2 = Instance.new("Weld",char) | |
110 | human2.Part0 = char.HumanoidRootPart | |
111 | human2.Part1 = char.Torso | |
112 | human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
113 | ||
114 | ||
115 | function changeblocktype(whattype) | |
116 | if whattype == "Grass" then | |
117 | changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96430265","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337") | |
118 | end | |
119 | if whattype == "Dirt" then | |
120 | changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755") | |
121 | end | |
122 | if whattype == "Cobblestone" then | |
123 | changeyourblockdecal("http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377") | |
124 | end | |
125 | if whattype == "Gold" then | |
126 | changeyourblockdecal("http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851") | |
127 | end | |
128 | if whattype == "Stone" then | |
129 | changeyourblockdecal("http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261") | |
130 | end | |
131 | if whattype == "DiamondBlock" then | |
132 | changeyourblockdecal("http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371") | |
133 | end | |
134 | if whattype == "DiamondOre" then | |
135 | changeyourblockdecal("http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647") | |
136 | end | |
137 | if whattype == "WoodenPlank" then | |
138 | changeyourblockdecal("http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036") | |
139 | end | |
140 | if whattype == "OakWood" then | |
141 | changeyourblockdecal("http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786") | |
142 | end | |
143 | if whattype == "GoldOre" then | |
144 | changeyourblockdecal("http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646") | |
145 | end | |
146 | if whattype == "Sponge" then | |
147 | changeyourblockdecal("http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383") | |
148 | end | |
149 | end | |
150 | ||
151 | changeblocktype("Grass") | |
152 | ||
153 | ||
154 | ||
155 | function playanim(whatanim,speed) | |
156 | if whatanim == "Place" then | |
157 | rhandweld.Parent = char.Torso | |
158 | for i = 0,1, speed do | |
159 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i) | |
160 | game:GetService("RunService").RenderStepped:wait() | |
161 | end | |
162 | for i = 0,1, speed do | |
163 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i) | |
164 | game:GetService("RunService").RenderStepped:wait() | |
165 | end | |
166 | end | |
167 | if whatanim == "Destroy" then | |
168 | rhandweld.Parent = char.Torso | |
169 | for i = 0,1, speed do | |
170 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i) | |
171 | game:GetService("RunService").RenderStepped:wait() | |
172 | end | |
173 | for i = 0,1, speed do | |
174 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i) | |
175 | game:GetService("RunService").RenderStepped:wait() | |
176 | end | |
177 | end | |
178 | if whatanim == "NormalPose" then | |
179 | for i = 0,1 , speed do | |
180 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1),i) | |
181 | game:GetService("RunService").RenderStepped:wait() | |
182 | end | |
183 | end | |
184 | end | |
185 | canuse = true | |
186 | mouse = plr:GetMouse() | |
187 | function buildblock() | |
188 | if canuse then | |
189 | canuse = false | |
190 | playanim("Place", 0.07) | |
191 | local theactualblock = Instance.new("Part") | |
192 | theactualblock:BreakJoints() | |
193 | theactualblock.Parent = workspace | |
194 | theactualblock.Transparency = 0 | |
195 | theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0) | |
196 | theactualblock.Orientation = Vector3.new(0,0,0) | |
197 | theactualblock.Size = Vector3.new(3,3,3) | |
198 | theactualblock.Anchored = true | |
199 | theactualblock.CanCollide = true | |
200 | theactualblock.Name = "BlockPlace" | |
201 | changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture) | |
202 | playanim("NormalPose", 0.3) | |
203 | canuse = true | |
204 | end | |
205 | end | |
206 | function destroyblock() | |
207 | if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then | |
208 | playanim("Destroy", 0.07) | |
209 | mouse.Target:Destroy() | |
210 | playanim("NormalPose", 0.3) | |
211 | end | |
212 | end | |
213 | local mouse1 = mouse.Button1Down:connect(function() | |
214 | buildblock() | |
215 | end) | |
216 | local mouse2 = mouse.KeyDown:connect(function(k) | |
217 | if k == "q" then | |
218 | destroyblock() | |
219 | end | |
220 | if k == "e" then | |
221 | local chance = math.random(1,11) | |
222 | if chance == 1 then | |
223 | changeblocktype("Grass") | |
224 | end | |
225 | if chance == 2 then | |
226 | changeblocktype("Dirt") | |
227 | end | |
228 | if chance == 3 then | |
229 | changeblocktype("Cobblestone") | |
230 | end | |
231 | if chance == 4 then | |
232 | changeblocktype("Gold") | |
233 | end | |
234 | if chance == 5 then | |
235 | changeblocktype("Stone") | |
236 | end | |
237 | if chance == 6 then | |
238 | changeblocktype("DiamondBlock") | |
239 | end | |
240 | if chance == 7 then | |
241 | changeblocktype("DiamondOre") | |
242 | end | |
243 | - | wait() |
243 | + | |
244 | changeblocktype("WoodenPlank") | |
245 | end | |
246 | if chance == 9 then | |
247 | - | wait() |
247 | + | |
248 | end | |
249 | if chance == 10 then | |
250 | changeblocktype("GoldOre") | |
251 | end | |
252 | if chance == 11 then | |
253 | changeblocktype("Sponge") | |
254 | - | wait() |
254 | + | |
255 | end | |
256 | end) | |
257 | HasDied = false | |
258 | - | wait() |
258 | + | |
259 | local reddeath = function() | |
260 | for i,v in pairs(char:GetChildren()) do | |
261 | if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then | |
262 | local cp = v:Clone() | |
263 | cp.Parent = effect | |
264 | - | wait() |
264 | + | |
265 | cp.Transparency = 1 | |
266 | cp.CanCollide = false | |
267 | cp.Material = Enum.Material.Neon | |
268 | if cp.Name == "Head" then | |
269 | cp.face:Destroy() | |
270 | end | |
271 | if cp.Name == "Torso" then | |
272 | cp.roblox:Destroy() | |
273 | end | |
274 | if v ~= char.Head then | |
275 | cp.Size = v.Size+(Vector3.new(1,1,1)*0.2) | |
276 | else | |
277 | cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2) | |
278 | end | |
279 | local weld = Instance.new("Weld",cp) | |
280 | weld.Part0 = v | |
281 | weld.Part1 = cp | |
282 | end | |
283 | end | |
284 | end | |
285 | reddeath() | |
286 | generategui = function() | |
287 | local screen = Instance.new("ScreenGui",plr.PlayerGui) | |
288 | screen.Name = "Death(lol i was lazy to add buttons lol)" | |
289 | local text = Instance.new("TextLabel",screen) | |
290 | text.Text = "You died!" | |
291 | text.TextColor3 = Color3.new(1,1,1) | |
292 | text.Font = "Arcade" | |
293 | text.TextScaled = true | |
294 | text.Position = UDim2.new(0.381, 0,0.172, 0) | |
295 | text.Size = UDim2.new(0, 200, 0, 50) | |
296 | text.BackgroundTransparency = 1 | |
297 | local respawn = Instance.new("TextButton",screen) | |
298 | respawn.Text = "Respawn" | |
299 | respawn.TextScaled = true | |
300 | respawn.Position = UDim2.new(0.381, 0,0.561, 0) | |
301 | respawn.Size = UDim2.new(0, 200,0, 50) | |
302 | respawn.BackgroundTransparency = 1 | |
303 | respawn.TextColor3 = Color3.new(1,1,1) | |
304 | respawn.Font = "Arcade" | |
305 | respawn.MouseButton1Click:connect(function() | |
306 | Dead = false | |
307 | HasDied = false | |
308 | char.Humanoid.Health = 0 | |
309 | char.Parent = nil | |
310 | respawn.Text = "Say g/r or g/sr to respawn properly" | |
311 | end) | |
312 | end | |
313 | local BODY = {} | |
314 | LeftArm = char["Left Arm"] | |
315 | RightLeg = char["Right Leg"] | |
316 | LeftLeg = char["Left Leg"] | |
317 | for _, c in pairs(char:GetDescendants()) do | |
318 | if c:IsA("BasePart") and c.Name ~= "Handle" then | |
319 | if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then | |
320 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
321 | end | |
322 | table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency}) | |
323 | elseif c:IsA("JointInstance") then | |
324 | table.insert(BODY,{c,c.Parent,nil,nil,nil}) | |
325 | end | |
326 | end | |
327 | for e = 1, #BODY do | |
328 | if BODY[e] ~= nil then | |
329 | local STUFF = BODY[e] | |
330 | local PART = STUFF[1] | |
331 | local PARENT = STUFF[2] | |
332 | local MATERIAL = STUFF[3] | |
333 | local TRANSPARENCY = STUFF[5] | |
334 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
335 | PART.Material = MATERIAL | |
336 | - | end |
336 | + | |
337 | - | end |
337 | + | |
338 | PART.AncestryChanged:Connect(function() | |
339 | PART.Parent = PARENT | |
340 | end) | |
341 | end | |
342 | end | |
343 | function refit() | |
344 | char.Parent = workspace | |
345 | for e = 1, #BODY do | |
346 | if BODY[e] ~= nil then | |
347 | local STUFF = BODY[e] | |
348 | local PART = STUFF[1] | |
349 | local PARENT = STUFF[2] | |
350 | local MATERIAL = STUFF[3] | |
351 | local TRANSPARENCY = STUFF[5] | |
352 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
353 | PART.Material = MATERIAL | |
354 | PART.Transparency = TRANSPARENCY | |
355 | end | |
356 | if PART.Parent ~= PARENT then | |
357 | char:FindFirstChildOfClass("Humanoid"):remove() | |
358 | PART.Parent = PARENT | |
359 | Humanoid = Instance.new("Humanoid",char) | |
360 | end | |
361 | end | |
362 | end | |
363 | end | |
364 | char.Humanoid.Died:connect(function() | |
365 | hurt:Play() | |
366 | refit() | |
367 | mouse1:Disconnect() | |
368 | mouse2:Disconnect() | |
369 | for i,v in pairs(effect:GetChildren()) do | |
370 | if v.ClassName == "Part" then | |
371 | v.Transparency = 0.7 | |
372 | end | |
373 | end | |
374 | workspace.CurrentCamera.CameraSubject = char.Head | |
375 | generategui() | |
376 | HasDied = true | |
377 | Dead = true | |
378 | for i = 0,1, 0.03 do | |
379 | human2.C0 = human2.C0:lerp(CFrame.new(1.99999964, -3.00000095, 0, -0.00852799695, 0.999963641, 0, -0.999963641, -0.00852799695, 0, 0, 0, 1):inverse() + Vector3.new(0,1,0),i) | |
380 | game:GetService("RunService").RenderStepped:wait() | |
381 | end | |
382 | end) | |
383 | while true do | |
384 | game:GetService("RunService").RenderStepped:wait() | |
385 | if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then | |
386 | reddamage(0.5) | |
387 | damaged = true | |
388 | wait(1) | |
389 | damaged = false | |
390 | char.Humanoid.Health = 100 | |
391 | end | |
392 | if char.Humanoid.Health < 1 and Dead and HasDied then | |
393 | refit() | |
394 | for i,v in pairs(effect:GetChildren()) do | |
395 | if v.ClassName == "Part" then | |
396 | v.Transparency = 0.7 | |
397 | end | |
398 | end | |
399 | end | |
400 | if Dead and HasDied then | |
401 | char.Humanoid.WalkSpeed = 0 | |
402 | char.Humanoid.JumpPower = 0 | |
403 | human2.Parent = char.Torso | |
404 | rhandweld.Parent = char.Torso | |
405 | end | |
406 | end |