Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- 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(),Button2Up=fakeEvent(),Button2Down=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
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- 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 typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v 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 rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- 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")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- LocalScript1 = Instance.new("LocalScript")
- Part2 = Instance.new("Part")
- BlockMesh3 = Instance.new("BlockMesh")
- Part4 = Instance.new("Part")
- BlockMesh5 = Instance.new("BlockMesh")
- Part6 = Instance.new("Part")
- SpecialMesh7 = Instance.new("SpecialMesh")
- Sound8 = Instance.new("Sound")
- Tool0.Name = "Leek"
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(-0, -0, 1)
- Tool0.GripRight = Vector3.new(-1, 0, 0)
- Tool0.ToolTip = "Equip to start the party!"
- Tool0.CanBeDropped = false
- LocalScript1.Name = "LeekScript"
- LocalScript1.Parent = Tool0
- table.insert(cors,sandbox(LocalScript1,function()
- local originalface=nil
- local user=nil
- Spawn(function()
- local prev
- local parts = script.Parent:GetChildren()
- for i = 1,#parts do
- if (parts[i].className == "Part") then
- if (prev ~= nil)then
- local weld = Instance.new("Weld")
- weld.Part0 = prev
- weld.Part1 = parts[i]
- weld.C0 = prev.CFrame:inverse()
- weld.C1 = parts[i].CFrame:inverse()
- weld.Parent = prev
- end
- prev = parts[i]
- prev.Anchored = false
- end
- end
- end)
- function onEquipped(mouse)
- print'start spin'
- down=true
- script.Parent.Handle.LeekSpin:Play()
- user=script.Parent.Parent
- originalface=script.Parent.Parent:WaitForChild("Head").face.Texture
- script.Parent.Parent:WaitForChild("Head").face.Texture="http://www.roblox.com/asset/?id=141452377"
- while down do
- script.Parent.Grip=script.Parent.Grip*CFrame.Angles(0,0,0.2)
- wait()
- end
- end
- function onUnequipped(mouse)
- down=false
- user:WaitForChild("Head").face.Texture=originalface
- script.Parent.Handle.LeekSpin:Stop()
- print'stop spin'
- end
- script.Parent.Equipped:connect(onEquipped)
- script.Parent.Unequipped:connect(onUnequipped)
- end))
- Part2.Parent = Tool0
- Part2.BrickColor = BrickColor.new("Camo")
- Part2.Rotation = Vector3.new(-165, 0, 180)
- Part2.CanCollide = false
- Part2.FormFactor = Enum.FormFactor.Custom
- Part2.Size = Vector3.new(0.200000003, 1, 0.400000006)
- Part2.CFrame = CFrame.new(13.2999926, 1.94176316, 13.0068178, -0.999999106, -1.96739265e-07, 1.70943835e-07, 5.28843771e-07, 0.965925574, 0.258818656, -8.13116685e-09, 0.258818835, -0.965924859)
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.227451, 0.490196, 0.0823529)
- Part2.Position = Vector3.new(13.2999926, 1.94176316, 13.0068178)
- Part2.Orientation = Vector3.new(-15, 180, 0)
- Part2.Color = Color3.new(0.227451, 0.490196, 0.0823529)
- BlockMesh3.Parent = Part2
- BlockMesh3.Scale = Vector3.new(0.5, 1, 0.5)
- BlockMesh3.Scale = Vector3.new(0.5, 1, 0.5)
- Part4.Parent = Tool0
- Part4.BrickColor = BrickColor.new("Camo")
- Part4.Rotation = Vector3.new(165, 0, 180)
- Part4.CanCollide = false
- Part4.FormFactor = Enum.FormFactor.Custom
- Part4.Size = Vector3.new(0.200000003, 1, 0.400000006)
- Part4.CFrame = CFrame.new(13.2999935, 1.94176269, 12.7931881, -0.999999046, -1.89076246e-07, -5.81593014e-08, 4.43757216e-07, 0.965925574, -0.258818597, -3.04669925e-08, -0.258818746, -0.965924978)
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.Color = Color3.new(0.227451, 0.490196, 0.0823529)
- Part4.Position = Vector3.new(13.2999935, 1.94176269, 12.7931881)
- Part4.Orientation = Vector3.new(15, -180, 0)
- Part4.Color = Color3.new(0.227451, 0.490196, 0.0823529)
- BlockMesh5.Parent = Part4
- BlockMesh5.Scale = Vector3.new(0.5, 1, 0.5)
- BlockMesh5.Scale = Vector3.new(0.5, 1, 0.5)
- Part6.Name = "Handle"
- Part6.Parent = Tool0
- Part6.BrickColor = BrickColor.new("Institutional white")
- Part6.Rotation = Vector3.new(69.9700012, 89.9300003, -12.4399996)
- Part6.RotVelocity = Vector3.new(1, 1, 1)
- Part6.CanCollide = false
- Part6.FormFactor = Enum.FormFactor.Custom
- Part6.Size = Vector3.new(0.200000003, 1.79999995, 0.200000003)
- Part6.CFrame = CFrame.new(13.2999935, 0.889999628, 12.9000025, 6.36468656e-08, 1.40425129e-08, 0.999999285, 3.72529279e-08, 0.999999523, -6.17590786e-07, -0.999999285, -1.26659813e-07, 2.25185218e-07)
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part6.Position = Vector3.new(13.2999935, 0.889999628, 12.9000025)
- Part6.Orientation = Vector3.new(0, 90, 0)
- Part6.Color = Color3.new(0.972549, 0.972549, 0.972549)
- SpecialMesh7.Parent = Part6
- Sound8.Name = "LeekSpin"
- Sound8.Parent = Part6
- Sound8.SoundId = "http://www.roblox.com/asset/?id=284819869"
- Sound8.Volume = 2
- Sound8.Looped = true
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement