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,game,owner = owner,game | |
| 4 | local RealPlayer = Player | |
| 5 | do | |
| 6 | print("FE Compatibility code V2 by Mokiros")
| |
| 7 | local RealPlayer = RealPlayer | |
| 8 | script.Parent = RealPlayer.Character | |
| 9 | ||
| 10 | --Fake event to make stuff like Mouse.KeyDown work | |
| 11 | local Disconnect_Function = function(this) | |
| 12 | this[1].Functions[this[2]] = nil | |
| 13 | end | |
| 14 | local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
| |
| 15 | local FakeEvent_Metatable = {__index={
| |
| 16 | Connect = function(this,f) | |
| 17 | local i = tostring(math.random(0,10000)) | |
| 18 | while this.Functions[i] do | |
| 19 | i = tostring(math.random(0,10000)) | |
| 20 | end | |
| 21 | this.Functions[i] = f | |
| 22 | return setmetatable({this,i},Disconnect_Metatable)
| |
| 23 | end | |
| 24 | }} | |
| 25 | FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect | |
| 26 | local function fakeEvent() | |
| 27 | return setmetatable({Functions={}},FakeEvent_Metatable)
| |
| 28 | end | |
| 29 | ||
| 30 | --Creating fake input objects with fake variables | |
| 31 | local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
| |
| 32 | FakeMouse.keyUp = FakeMouse.KeyUp | |
| 33 | FakeMouse.keyDown = FakeMouse.KeyDown | |
| 34 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 35 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 36 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 37 | end} | |
| 38 | --Merged 2 functions into one by checking amount of arguments | |
| 39 | CAS.UnbindAction = CAS.BindAction | |
| 40 | ||
| 41 | --This function will trigger the events that have been :Connect()'ed | |
| 42 | local function TriggerEvent(self,ev,...) | |
| 43 | for _,f in pairs(self[ev].Functions) do | |
| 44 | f(...) | |
| 45 | end | |
| 46 | end | |
| 47 | FakeMouse.TriggerEvent = TriggerEvent | |
| 48 | UIS.TriggerEvent = TriggerEvent | |
| 49 | ||
| 50 | --Client communication | |
| 51 | local Event = Instance.new("RemoteEvent")
| |
| 52 | Event.Name = "UserInput_Event" | |
| 53 | Event.OnServerEvent:Connect(function(plr,io) | |
| 54 | if plr~=RealPlayer then return end | |
| 55 | FakeMouse.Target = io.Target | |
| 56 | FakeMouse.Hit = io.Hit | |
| 57 | if not io.isMouse then | |
| 58 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 59 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 60 | return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up") | |
| 61 | end | |
| 62 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
| 63 | return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up") | |
| 64 | end | |
| 65 | for _,t in pairs(CAS.Actions) do | |
| 66 | for _,k in pairs(t.Keys) do | |
| 67 | if k==io.KeyCode then | |
| 68 | t.Function(t.Name,io.UserInputState,io) | |
| 69 | end | |
| 70 | end | |
| 71 | end | |
| 72 | FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 73 | UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 74 | end | |
| 75 | end) | |
| 76 | Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
| |
| 77 | local Mouse = owner:GetMouse() | |
| 78 | local UIS = game:GetService("UserInputService")
| |
| 79 | local input = function(io,RobloxHandled) | |
| 80 | if RobloxHandled then return end | |
| 81 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 82 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 83 | end | |
| 84 | UIS.InputBegan:Connect(input) | |
| 85 | UIS.InputEnded:Connect(input) | |
| 86 | local h,t | |
| 87 | --Give the server mouse data every second frame, but only if the values changed | |
| 88 | --If player is not moving their mouse, client won't fire events | |
| 89 | local HB = game:GetService("RunService").Heartbeat
| |
| 90 | while true do | |
| 91 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 92 | h,t=Mouse.Hit,Mouse.Target | |
| 93 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 94 | end | |
| 95 | --Wait 2 frames | |
| 96 | for i=1,2 do | |
| 97 | HB:Wait() | |
| 98 | end | |
| 99 | end]==],script) | |
| 100 | ||
| 101 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 102 | --Real game object | |
| 103 | local RealGame = game | |
| 104 | ||
| 105 | --Metatable for fake service | |
| 106 | local FakeService_Metatable = {
| |
| 107 | __index = function(self,k) | |
| 108 | local s = rawget(self,"_RealService") | |
| 109 | if s then | |
| 110 | return typeof(s[k])=="function" | |
| 111 | and function(_,...)return s[k](s,...)end or s[k] | |
| 112 | end | |
| 113 | end, | |
| 114 | __newindex = function(self,k,v) | |
| 115 | local s = rawget(self,"_RealService") | |
| 116 | if s then s[k]=v end | |
| 117 | end | |
| 118 | } | |
| 119 | local function FakeService(t,RealService) | |
| 120 | t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService | |
| 121 | return setmetatable(t,FakeService_Metatable) | |
| 122 | end | |
| 123 | ||
| 124 | --Fake game object | |
| 125 | local FakeGame = {
| |
| 126 | GetService = function(self,s) | |
| 127 | return rawget(self,s) or RealGame:GetService(s) | |
| 128 | end, | |
| 129 | Players = FakeService({
| |
| 130 | LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
| |
| 131 | },"Players"), | |
| 132 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 133 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 134 | RunService = FakeService({
| |
| 135 | _btrs = {},
| |
| 136 | RenderStepped = RealGame:GetService("RunService").Heartbeat,
| |
| 137 | BindToRenderStep = function(self,name,_,fun) | |
| 138 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 139 | end, | |
| 140 | UnbindFromRenderStep = function(self,name) | |
| 141 | self._btrs[name]:Disconnect() | |
| 142 | end, | |
| 143 | },"RunService") | |
| 144 | } | |
| 145 | rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer) | |
| 146 | FakeGame.service = FakeGame.GetService | |
| 147 | FakeService(FakeGame,game) | |
| 148 | --Changing owner to fake player object to support owner:GetMouse() | |
| 149 | game,owner = FakeGame,FakeGame.Players.LocalPlayer | |
| 150 | end | |
| 151 | if script.ClassName~="LocalScript" then wait(math.huge) end | |
| 152 | peron = game.Players["lifeepic"] | |
| 153 | Player=peron | |
| 154 | player=peron | |
| 155 | person=peron | |
| 156 | Person=peron | |
| 157 | script.Parent=peron | |
| 158 | FF=false | |
| 159 | FF2=Instance.new("ForceField")
| |
| 160 | --if peron.Backpack:findFirstChild("Chair") == nil then
| |
| 161 | -- local h = Instance.new("HopperBin")
| |
| 162 | -- h.Name = "Chair" h.Parent = peron.Backpack | |
| 163 | -- script.Parent = h | |
| 164 | -- p = Instance.new("IntValue")
| |
| 165 | -- p.Name = "Damage" p.Parent = h | |
| 166 | -- p.Value = 75 | |
| 167 | -- wait(math.huge) | |
| 168 | -- end | |
| 169 | range = 50 | |
| 170 | speed = 15 | |
| 171 | function chair() | |
| 172 | local h = Instance.new("HopperBin")
| |
| 173 | FIRE=false | |
| 174 | h.Name = "Chair" h.Parent = peron.Backpack | |
| 175 | p = Instance.new("IntValue")
| |
| 176 | p.Name = "Damage" p.Parent = h | |
| 177 | p.Value = 75 | |
| 178 | wait(1) | |
| 179 | local bin = peron.Backpack.Chair | |
| 180 | me1 = peron me = peron.Character | |
| 181 | distance = 3/2 | |
| 182 | follow = false | |
| 183 | damage = bin.Damage | |
| 184 | p = Instance.new("IntValue")
| |
| 185 | p.Name = "Safe" p.Parent = me | |
| 186 | if me:findFirstChild("part1") == nil then
| |
| 187 | local part1 = Instance.new("Seat")
| |
| 188 | part1.BrickColor = BrickColor.new("Black")
| |
| 189 | part1.Transparency = 0 part1.TopSurface = 0 part1.BottomSurface = 0 part1.Reflectance = math.huge part1.Locked = true part1.Size = Vector3.new(1,1,1) part1.Anchored = false part1.Shape = 0 part1.CanCollide = false part1.Name = "part1" | |
| 190 | local mesh = Instance.new("SpecialMesh") mesh.Parent = part1 part1.Reflectance=math.huge mesh.Scale = Vector3.new(2,1.75,2) mesh.MeshType = "Sphere"
| |
| 191 | bp = Instance.new("BodyPosition") bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
| |
| 192 | bp.Parent = part1 | |
| 193 | bp.position=peron.Character.Torso.Position | |
| 194 | part1.CFrame=peron.Character.Torso.CFrame | |
| 195 | local bg = Instance.new("BodyGyro") bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge) bg.Parent = part1
| |
| 196 | main = part1:Clone() | |
| 197 | local part2 = Instance.new("Part") part2.BrickColor = BrickColor.new("White") part2.Transparency = 0 part2.TopSurface = 0 part2.BottomSurface = 0 part2.Locked = true part2.Size = Vector3.new(1,1,1) part2.Anchored = false part2.Shape = 0 part2.CanCollide = false part2.Name = "part2"
| |
| 198 | local mesh = Instance.new("BlockMesh") mesh.Parent = part2 mesh.Scale = Vector3.new(3,0.75,3)
| |
| 199 | local part3 = Instance.new("Part") part3.BrickColor = BrickColor.new("White") part3.Transparency = 0 part3.TopSurface = 0 part3.BottomSurface = 0 part3.Locked = true part3.Size = Vector3.new(1,0.5,1) part3.Anchored = false part3.Shape = 0 part3.CanCollide = false part3.Name = "part3"
| |
| 200 | local mesh = Instance.new("CylinderMesh") mesh.Parent = part3 mesh.Scale = Vector3.new(2.5,0.5,2.5)
| |
| 201 | local part4 = Instance.new("Part") part4.BrickColor = BrickColor.new("White") part4.Transparency = 0 part4.TopSurface = 0 part4.BottomSurface = 0 part4.Locked = true part4.Size = Vector3.new(1,1,1) part4.Anchored = false part4.Shape = 0 part4.CanCollide = false part4.Name = "part4"
| |
| 202 | local mesh = Instance.new("BlockMesh") mesh.Parent = part4 mesh.Scale = Vector3.new(3,3,0.5)
| |
| 203 | local part5 = Instance.new("Part") part5.BrickColor = BrickColor.new("White") part5.Transparency = 0 part5.TopSurface = 0 part5.BottomSurface = 0 part5.Locked = true part5.Size = Vector3.new(1,0.5,1) part5.Anchored = false part5.Shape = 0 part5.CanCollide = false part5.Name = "part5"
| |
| 204 | local mesh = Instance.new("CylinderMesh") mesh.Parent = part5 mesh.Scale = Vector3.new(1.5,0.5,1.5)
| |
| 205 | local part6 = Instance.new("Part") part6.BrickColor = BrickColor.new("Black") part6.Transparency = 0 part6.TopSurface = 0 part6.BottomSurface = 0 part6.Locked = true part6.Size = Vector3.new(1,1,1) part6.Anchored = false part6.Shape = 0 part6.CanCollide = false part6.Name = "part6"
| |
| 206 | local mesh1 = Instance.new("SpecialMesh") mesh1.Parent = part6 part6.Reflectance=math.huge mesh1.Scale = Vector3.new(1,1,1) mesh1.MeshType = "Sphere"
| |
| 207 | local part7 = Instance.new("Part") part7.BrickColor = BrickColor.new("White") part7.Transparency = 0 part7.TopSurface = 0 part7.BottomSurface = 0 part7.Locked = true part7.Size = Vector3.new(1,1,1) part7.Anchored = false part7.Shape = 0 part7.CanCollide = false part7.Name = "part7"
| |
| 208 | local mesh = Instance.new("BlockMesh") mesh.Parent = part7 mesh.Scale = Vector3.new(1,0.25,1)
| |
| 209 | local part8 = Instance.new("Part") part8.BrickColor = BrickColor.new("White") part8.Transparency = 0 part8.TopSurface = 0 part8.BottomSurface = 0 part8.Locked = true part8.Size = Vector3.new(1,1,1) part8.Anchored = false part8.Shape = 0 part8.CanCollide = false part8.Name = "part8"
| |
| 210 | local mesh = Instance.new("BlockMesh") mesh.Parent = part8 mesh.Scale = Vector3.new(1,0.25,1)
| |
| 211 | local part9 = Instance.new("Part") part9.BrickColor = BrickColor.new("White") part9.Transparency = 0 part9.TopSurface = 0 part9.BottomSurface = 0 part9.Locked = true part9.Size = Vector3.new(1,1,1) part9.Anchored = false part9.Shape = 0 part9.CanCollide = false part9.Name = "part9"
| |
| 212 | local mesh = Instance.new("BlockMesh") mesh.Parent = part9 mesh.Scale = Vector3.new(1,0.25,3)
| |
| 213 | local part10 = Instance.new("Part") part10.BrickColor = BrickColor.new("White") part10.Transparency = 0 part10.TopSurface = 0 part10.BottomSurface = 0 part10.Locked = true part10.Size = Vector3.new(1,1,1) part10.Anchored = false part10.Shape = 0 part10.CanCollide = false part10.Name = "part10"
| |
| 214 | local mesh = Instance.new("BlockMesh") mesh.Parent = part10 mesh.Scale = Vector3.new(1,0.25,3)
| |
| 215 | part11 = Instance.new("Part") part11.BrickColor = BrickColor.new("Black") part11.Transparency = 0 part11.TopSurface = 0 part11.BottomSurface = 0 part11.Locked = true part11.Size = Vector3.new(1,1,1) part11.Anchored = false part11.Shape = 0 part11.CanCollide = false part11.Name = "part11"
| |
| 216 | local mesh = Instance.new("BlockMesh") mesh.Parent = part11 mesh.Scale = Vector3.new(0.2,0.2,0.5)
| |
| 217 | part12 = Instance.new("Part") part12.BrickColor = BrickColor.new("Black") part12.Transparency = 0 part12.TopSurface = 0 part12.BottomSurface = 0 part12.Locked = true part12.Size = Vector3.new(1,1,1) part12.Anchored = false part12.Shape = 0 part12.CanCollide = false part12.Name = "part12"
| |
| 218 | local mesh = Instance.new("BlockMesh") mesh.Parent = part12 mesh.Scale = Vector3.new(0.2,0.2,0.5) main.Parent = me part2.Parent = me part3.Parent = me part4.Parent = me part5.Parent = me part6.Parent = me part7.Parent = me part8.Parent = me part9.Parent = me part10.Parent = me part11.Parent = me part12.Parent = me
| |
| 219 | ||
| 220 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part2 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, -0.5, 0)
| |
| 221 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part3 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
| |
| 222 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part4 weld.C1 = CFrame.fromEulerAnglesXYZ(-0.1, 0, 0) * CFrame.new(0, -2, -0.75)
| |
| 223 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part5 weld.C1 = CFrame.fromEulerAnglesXYZ(-4.815, 0, 0) * CFrame.new(0, -2, -1)
| |
| 224 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part6 weld.C1 = CFrame.fromEulerAnglesXYZ(-4.815, 0, 0) * CFrame.new(0, -2, -1.25)
| |
| 225 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part7 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(1.75, -0.5, 0)
| |
| 226 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part8 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-1.75, -0.5, 0)
| |
| 227 | ||
| 228 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part9 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-1.5, -1.875, 0)
| |
| 229 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part10 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(1.5, -1.875, 0)
| |
| 230 | ||
| 231 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part11 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(2, -0.5, 0.75)
| |
| 232 | local weld = Instance.new("Weld") weld.Parent = main weld.Part0 = main weld.Part1 = part12 weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-2, -0.5, 0.75)
| |
| 233 | ||
| 234 | end | |
| 235 | beam=Instance.new("Part")
| |
| 236 | beam1=Instance.new("Part")
| |
| 237 | function wire(pos1,pos2,ref) | |
| 238 | local P = beam | |
| 239 | local P2 = pos1 | |
| 240 | local P1 = pos2 | |
| 241 | P.Parent=peron | |
| 242 | P.Name = "Beam" | |
| 243 | local Place0 = CFrame.new(P2.x,P2.y,P2.z) | |
| 244 | P.formFactor = 0 | |
| 245 | --P.Size = Vector3.new(1,1,(P1 - P2).magnitude) | |
| 246 | P.Size=Vector3.new(0.1,0.1,0.1) | |
| 247 | P.CFrame = CFrame.new((P1 + P2)/2,Place0.p) | |
| 248 | P.Parent = player.Character | |
| 249 | P.BrickColor = BrickColor.new("Bright blue")
| |
| 250 | P.Transparency = 0.5 | |
| 251 | P.Reflectance = ref | |
| 252 | P.Anchored = true | |
| 253 | P.CanCollide = false | |
| 254 | P.TopSurface = "Smooth" | |
| 255 | P.BottomSurface = "Smooth" | |
| 256 | local m = Instance.new("SpecialMesh")
| |
| 257 | m.Parent = P | |
| 258 | m.MeshType = "Brick" | |
| 259 | m.Scale = Vector3.new(.1,.1,(P1 - P2).magnitude) | |
| 260 | return P | |
| 261 | end | |
| 262 | ||
| 263 | ||
| 264 | function wire2(pos1,pos2,ref) | |
| 265 | local P = beam1 | |
| 266 | local P2 = pos1 | |
| 267 | local P1 = pos2 | |
| 268 | P.Name = "Beam" | |
| 269 | local Place0 = CFrame.new(P2.x,P2.y,P2.z) | |
| 270 | P.formFactor = 0 | |
| 271 | P.Parent=peron | |
| 272 | --P.Size = Vector3.new(1,1,(P1 - P2).magnitude) | |
| 273 | P.Size=Vector3.new(0.1,0.1,0.1) | |
| 274 | P.CFrame = CFrame.new((P1 + P2)/2,Place0.p) | |
| 275 | P.Parent = player.Character | |
| 276 | P.BrickColor = BrickColor.new("Bright blue")
| |
| 277 | P.Transparency = 0.5 | |
| 278 | P.Reflectance = ref | |
| 279 | P.Anchored = true | |
| 280 | P.CanCollide = false | |
| 281 | P.TopSurface = "Smooth" | |
| 282 | P.BottomSurface = "Smooth" | |
| 283 | local m = Instance.new("SpecialMesh")
| |
| 284 | m.Parent = P | |
| 285 | m.MeshType = "Brick" | |
| 286 | m.Scale = Vector3.new(.1,.1,(P1 - P2).magnitude) | |
| 287 | return P | |
| 288 | end | |
| 289 | ||
| 290 | ||
| 291 | ||
| 292 | function Balefire(pos, obj) | |
| 293 | hum = obj.Parent:findFirstChild("Humanoid")
| |
| 294 | if hum ~= nil then | |
| 295 | local P = Instance.new("Part")
| |
| 296 | P.Name = "Laser" | |
| 297 | local Place0 = me.part12.CFrame | |
| 298 | P.formFactor = 0 | |
| 299 | P.Parent = game.Workspace | |
| 300 | P.Color = Color3.new(math.random(0,1),math.random(0,1),math.random(0,1)) | |
| 301 | P.Transparency = 0.25 P.Reflectance = 0.25 P.Anchored = true P.formFactor = "Plate" P.CanCollide = false | |
| 302 | pl = Instance.new("BlockMesh")
| |
| 303 | pl.Scale = Vector3.new(0.1,0.2,1) | |
| 304 | pl.Parent = P | |
| 305 | P.Size = Vector3.new(1,0.4,(Place0.p - pos).magnitude) | |
| 306 | P.CFrame = CFrame.new((Place0.p + pos)/2, Place0.p) | |
| 307 | if hum.Health <= 100 then | |
| 308 | hum.Health = hum.Health - damage.Value else hum.Health = 0 end wait(0.01) P:Remove() end | |
| 309 | end | |
| 310 | function Balefire1(pos, obj) | |
| 311 | hum = obj.Parent:findFirstChild("Humanoid")
| |
| 312 | if hum ~= nil then | |
| 313 | local P = Instance.new("Part") P.Name = "Laser"
| |
| 314 | local Place0 = me.part11.CFrame P.formFactor = 0 P.Parent = game.Workspace | |
| 315 | P.Color = Color3.new(math.random(0,1),math.random(0,1),math.random(0,1)) | |
| 316 | P.Transparency = 0.25 P.Reflectance = 0.25 P.Anchored = true P.formFactor = "Plate" P.CanCollide = false | |
| 317 | pl = Instance.new("BlockMesh") pl.Scale = Vector3.new(0.1,0.2,1) pl.Parent = P
| |
| 318 | P.Size = Vector3.new(1,0.4,(Place0.p - pos).magnitude) P.CFrame = CFrame.new((Place0.p + pos)/2, Place0.p) | |
| 319 | if hum.Health <= 100 then hum.Health = hum.Health - damage.Value else hum.Health = 0 end wait(0.01) P:Remove() end | |
| 320 | end | |
| 321 | function findNearestTorso(pos) | |
| 322 | local list = game.Workspace:getChildren() | |
| 323 | local torso = nil | |
| 324 | local dist = range | |
| 325 | local temp = nil | |
| 326 | local human = nil | |
| 327 | local temp2 = nil | |
| 328 | for x = 1, #list do | |
| 329 | temp2 = list[x] | |
| 330 | local safe = temp2:findFirstChild("Safe")
| |
| 331 | if (temp2.className == "Model") and (safe == nil) and damage.Value > 0 then | |
| 332 | temp = temp2:findFirstChild("Torso") human = temp2:findFirstChild("Humanoid")
| |
| 333 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
| 334 | if (temp.Position - pos).magnitude < dist then | |
| 335 | torso = temp dist = (temp.Position - pos).magnitude | |
| 336 | end | |
| 337 | end | |
| 338 | end | |
| 339 | if (temp2.className == "Model") and damage.Value <= 0 then | |
| 340 | temp = temp2:findFirstChild("Torso")
| |
| 341 | human = temp2:findFirstChild("Humanoid")
| |
| 342 | if (temp ~= nil) and (human ~= nil) and (human.Health < 100) then | |
| 343 | if (temp.Position - pos).magnitude < dist then | |
| 344 | torso = temp | |
| 345 | dist = (temp.Position - pos).magnitude | |
| 346 | end | |
| 347 | end | |
| 348 | end | |
| 349 | end | |
| 350 | return torso | |
| 351 | end | |
| 352 | function onButton1Down(mouse) | |
| 353 | local player = peron | |
| 354 | main = me.part1 | |
| 355 | main.Anchored = false | |
| 356 | me1 = peron | |
| 357 | follow = true | |
| 358 | while follow == true do | |
| 359 | distance = 3/2 mousehit = mouse.Hit.p if (main.BodyPosition.position - mousehit).magnitude >speed then | |
| 360 | main_mousehit = (main.BodyPosition.position - mousehit).unit*speed | |
| 361 | else | |
| 362 | main_mousehit = (main.BodyPosition.position - mousehit).unit*1 | |
| 363 | end | |
| 364 | start1 = main.BodyPosition.position-main_mousehit | |
| 365 | main.BodyPosition.position = Vector3.new(start1.x, start1.y, start1.z) | |
| 366 | local dir = (mousehit - main.Position).unit | |
| 367 | local spawnPos = main.Position | |
| 368 | local pos = spawnPos + (dir * 1) | |
| 369 | local dir = (pos - main.Position) | |
| 370 | local Angle = ((mouse.ViewSizeX/2)-mouse.X)/100 | |
| 371 | if math.abs(Angle) > 1 then if Angle > 0 then Angle = Angle - 1 else Angle = Angle + 1 end | |
| 372 | ||
| 373 | Angle = Angle * math.abs(26) / 70 main.BodyGyro.cframe = CFrame.new(pos, pos + dir) * CFrame.fromEulerAnglesXYZ(0, 0, Angle) else main.BodyGyro.cframe = CFrame.new(pos, pos + dir) end | |
| 374 | wait() end end | |
| 375 | function onButton1Up(mouse) | |
| 376 | main = me.part1 | |
| 377 | main.Anchored = false | |
| 378 | follow = false | |
| 379 | end | |
| 380 | local msg = Instance.new("Hint")
| |
| 381 | ||
| 382 | function say(tehmessage) | |
| 383 | msg.Parent = me1 | |
| 384 | msg.Text = tehmessage | |
| 385 | wait(2) | |
| 386 | msg.Parent = nil | |
| 387 | end | |
| 388 | ||
| 389 | function onKeyUp(key,mouse) | |
| 390 | if (key=="e") then FIRE=false end | |
| 391 | end | |
| 392 | ||
| 393 | function onKeyDown(key,mouse) | |
| 394 | if (key~=nil) then | |
| 395 | if (key=="f") then speed = speed+1 say("speed: "..speed)
| |
| 396 | elseif (key=="c") then | |
| 397 | speed = speed-1 say("speed: "..speed)
| |
| 398 | elseif (key=="g") then | |
| 399 | range = range+1 say("range: "..range)
| |
| 400 | elseif (key=="x") then | |
| 401 | FF3=Instance.new("ForceField",peron.Character)
| |
| 402 | main.Anchored=true | |
| 403 | X=Instance.new("Explosion")
| |
| 404 | X.Parent=workspace | |
| 405 | X.BlastPressure=math.huge | |
| 406 | X.BlastRadius=10 | |
| 407 | X.Position=peron.Character.Torso.Position | |
| 408 | while X.Parent do wait() end | |
| 409 | wait() | |
| 410 | FF3:remove() | |
| 411 | main.Anchored=false | |
| 412 | elseif (key=="v") then | |
| 413 | if range == 0 then return end | |
| 414 | range = range-1 say("range: "..range)
| |
| 415 | elseif (key=="h") then | |
| 416 | damage.Value = damage.Value+1 say("damage: "..damage.Value)
| |
| 417 | elseif (key=="m") then | |
| 418 | main.CFrame=peron.Character.Torso.CFrame | |
| 419 | main.BodyPosition.position=peron.Character.Torso.Position | |
| 420 | elseif (key=="n") then | |
| 421 | FF=not FF | |
| 422 | if FF then FF2.Parent=peron.Character else FF2.Parent=nil end | |
| 423 | elseif (key=="b") then | |
| 424 | damage.Value = damage.Value-1 say("damage: "..damage.Value)
| |
| 425 | elseif (key=="r") then | |
| 426 | speed = 2 range = 0 damage.Value = 0 say("speed: "..speed) say("damage: "..damage.Value) say("range: "..range)
| |
| 427 | elseif (key=="e") then | |
| 428 | FIRE=true | |
| 429 | while FIRE do | |
| 430 | wire(part11.Position,mouse.Hit.p,math.huge) | |
| 431 | wire2(part12.Position,mouse.Hit.p,math.huge) | |
| 432 | if mouse.Target then | |
| 433 | mouse.Target:breakJoints() | |
| 434 | if mouse.Target:getMass()<1000 then mouse.Target.Anchored=false end | |
| 435 | end | |
| 436 | wait() | |
| 437 | end | |
| 438 | beam.Parent=nil | |
| 439 | beam1.Parent=nil | |
| 440 | elseif (key=="q") then | |
| 441 | local target = findNearestTorso(me.Torso.Position) | |
| 442 | if target ~= nil then | |
| 443 | baned = game.Players:children() | |
| 444 | for x = 1, #baned do | |
| 445 | if baned[x].Name == peron.Name then | |
| 446 | head = target.Parent:findFirstChild("Humanoid")
| |
| 447 | if head.Health ~= 0 then | |
| 448 | tag = Instance.new("ObjectValue") tag.Value = baned[x] tag.Name = "creator" tag.Parent = head
| |
| 449 | Balefire(target.Position, target) Balefire1(target.Position, target) | |
| 450 | end | |
| 451 | end | |
| 452 | end | |
| 453 | end | |
| 454 | end | |
| 455 | end | |
| 456 | end | |
| 457 | ||
| 458 | function onSelected(mouse) | |
| 459 | mouse.Icon = "rbxasset://textures\\GunCursor.png" | |
| 460 | mouse.Button1Down:connect(function() onButton1Down(mouse) end) | |
| 461 | mouse.Button1Up:connect(function() onButton1Up(mouse) end) | |
| 462 | mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end) | |
| 463 | mouse.KeyUp:connect(function(key) onKeyUp(key,mouse) end) | |
| 464 | end | |
| 465 | ||
| 466 | bin.Selected:connect(onSelected) -- LEGO | |
| 467 | end | |
| 468 | peron.CharacterAdded:connect(function() wait() chair() end) | |
| 469 | chair() | |
| 470 | ||
| 471 | ||
| 472 | ||
| 473 | ||
| 474 | ||
| 475 | ||
| 476 | local HINT=Instance.new("ScreenGui",peron.PlayerGui)
| |
| 477 | local Text=Instance.new("Frame",HINT)
| |
| 478 | --Instance.new("ForceField",peron.Character)
| |
| 479 | Text.Position=UDim2.new(0.290000057, 0, 0.00999999978, 0) | |
| 480 | Text.Size=UDim2.new(0.45, 0, 0.0399999991, 0) | |
| 481 | --Text.Style="RobloxRound" | |
| 482 | Text.BackgroundTransparency=0.5 | |
| 483 | local INNER=Instance.new("TextLabel")
| |
| 484 | INNER.Parent=Text | |
| 485 | INNER.Position=UDim2.new(0.5,0,0.5,0) | |
| 486 | INNER.TextColor3=Color3.new(1,1,1) | |
| 487 | while wait() do | |
| 488 | INNER.Text="HoverChair OS | F Speed: "..speed.." C | To Fire YAR LAZERS, press Q. | N for FF, M to call " | |
| 489 | Text.Parent=HINT | |
| 490 | INNER.Parent=Text | |
| 491 | HINT.Parent=peron.PlayerGui | |
| 492 | end | |
| 493 | ||
| 494 | --mediafire gtfo password |