Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- mouse = game.Players.LuaScripterLS:GetMouse()
- game:GetService("Chat"):Chat(Workspace.LuaScripterLS.Head,"HAM AND CHEESE SPIRIT WOO")
- wait()
- game:GetService("Chat"):Chat(Workspace.LuaScripterLS.Head,"WEEABOO NO JUTSU!")
- wait(1)
- Workspace.LuaScripterLS.Humanoid.MaxHealth = math.huge
- Workspace.LuaScripterLS.Humanoid.WalkSpeed = 30
- Workspace.LuaScripterLS["Left Arm"].BrickColor = BrickColor.new("Cool yellow")
- Workspace.LuaScripterLS.Torso.BrickColor = BrickColor.new("Cool yellow")
- Workspace.LuaScripterLS.Head.BrickColor = BrickColor.new("Cool yellow")
- Workspace.LuaScripterLS["Right Arm"].BrickColor = BrickColor.new("Cool yellow")
- Workspace.LuaScripterLS["Left Leg"].BrickColor = BrickColor.new("Cool yellow")
- Workspace.LuaScripterLS["Right Leg"].BrickColor = BrickColor.new("Cool yellow")
- -- Main
- Handle = Instance.new("Part",Workspace.LuaScripterLS)
- Handle.TopSurface = "Smooth"
- Handle.BottomSurface = "Smooth"
- Handle.CanCollide = True
- Handle.BrickColor = BrickColor.new("Deep orange")
- Handle.Reflectance = 0.3
- Handle.Transparency = 0.3
- local HandleMesh = Instance.new("SpecialMesh",Handle) HandleMesh.MeshType = "FileMesh" HandleMesh.MeshId = "http://www.roblox.com/asset/?id=36780113"
- HandleMesh.Scale = Vector3.new(10, 15, 10)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = Handle
- Weld.C1 = CFrame.new(0, -3, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
- RA = Instance.new("Part",Workspace.LuaScripterLS)
- RA.TopSurface = "Smooth"
- RA.BottomSurface = "Smooth"
- RA.CanCollide = True
- RA.BrickColor = BrickColor.new("Bright red")
- RA.Reflectance = 0.3
- RA.Transparency = 0.3
- local RAMesh = Instance.new("SpecialMesh",RA) RAMesh.MeshType = "FileMesh" RAMesh.MeshId = "http://www.roblox.com/asset/?id=36780156"
- RAMesh.Scale = Vector3.new(5, 8, 10)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = RA
- Weld.C1 = CFrame.new(-13, -3, -2)*CFrame.fromEulerAnglesXYZ(0, 0, -.4)
- LA = Instance.new("Part",Workspace.LuaScripterLS)
- LA.TopSurface = "Smooth"
- LA.BottomSurface = "Smooth"
- LA.CanCollide = True
- LA.BrickColor = BrickColor.new("Bright red")
- LA.Reflectance = 0.3
- LA.Transparency = 0.3
- local LAMesh = Instance.new("SpecialMesh",LA) LAMesh.MeshType = "FileMesh" LAMesh.MeshId = "http://www.roblox.com/asset/?id=36780032"
- LAMesh.Scale = Vector3.new(5, 8, 10)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = LA
- Weld.C1 = CFrame.new(13, -3, -2)*CFrame.fromEulerAnglesXYZ(0, 0, .4)
- Head = Instance.new("Part",Workspace.LuaScripterLS)
- Head.TopSurface = "Smooth"
- Head.BottomSurface = "Smooth"
- Head.CanCollide = True
- Head.BrickColor = BrickColor.new("Bright red")
- Head.Reflectance = 0.3
- Head.Transparency = 0.3
- local HeadMesh = Instance.new("SpecialMesh",Head) HeadMesh.MeshType = "FileMesh" HeadMesh.MeshId = "http://www.roblox.com/asset/?id=62719736"
- HeadMesh.Scale = Vector3.new(5, 5, 5)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = Head
- Weld.C1 = CFrame.new(0, -23, 3)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
- Katana = Instance.new("Part",Workspace.LuaScripterLS)
- Katana.TopSurface = "Smooth"
- Katana.BottomSurface = "Smooth"
- Katana.CanCollide = True
- Katana.BrickColor = BrickColor.new("Really black")
- Katana.Reflectance = 0.3
- Katana.Transparency = 0.3
- local KatanaMesh = Instance.new("SpecialMesh",Katana) KatanaMesh.MeshType = "FileMesh" KatanaMesh.MeshId = "http://www.roblox.com/asset/?id=11442510"
- KatanaMesh.Scale = Vector3.new(10, 10, 10)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = Katana
- Weld.C1 = CFrame.new(-14, 0, -10)*CFrame.fromEulerAnglesXYZ(-10, 0, 0)
- Sphere = Instance.new("Part",Workspace.LuaScripterLS)
- Sphere.TopSurface = "Smooth"
- Sphere.BottomSurface = "Smooth"
- Sphere.CanCollide = True
- Sphere.BrickColor = BrickColor.new("Bright red")
- Sphere.Reflectance = 0.3
- Sphere.Transparency = 0.3
- local SphereMesh = Instance.new("SpecialMesh",Sphere)
- SphereMeshType = "Sphere"
- SphereMesh.Scale = Vector3.new(4, 6, 4)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = Sphere
- Weld.C1 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
- H = Instance.new("Part",Workspace.LuaScripterLS)
- H.TopSurface = "Smooth"
- H.BottomSurface = "Smooth"
- H.CanCollide = True
- H.BrickColor = BrickColor.new("Really black")
- local HMesh = Instance.new("SpecialMesh",H) HMesh.MeshType = "FileMesh" HMesh.MeshId = "http://www.roblox.com/asset/?id=62246019"
- HMesh.Scale = Vector3.new(1, 1, 1)
- Weld = Instance.new("Weld",Workspace.LuaScripterLS)
- Weld.Part0 = game.Workspace.LuaScripterLS["Torso"]
- Weld.Part1 = H
- Weld.C1 = CFrame.new(0, -1.7, -.2)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
- Shield = Instance.new("ForceField",Workspace.LuaScripterLS)
- Shirt = Instance.new("Shirt",Character)
- Shirt.Parent = game.Workspace.LuaScripterLS
- Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=77026846"
- Pant = Instance.new("Pants",Character)
- Pant.Parent = game.Workspace.LuaScripterLS
- Pant.PantsTemplate = "http://www.roblox.com/asset/?id=89662457"
- --kill
- Sphere.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement