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(),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
- player = game.Players.LocalPlayer
- char = player.Character
- mas = char.Torso
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Part2 = Instance.new("Part")
- Weld3 = Instance.new("Weld")
- CFrameValue4 = Instance.new("CFrameValue")
- Part5 = Instance.new("Part")
- Weld6 = Instance.new("Weld")
- CFrameValue7 = Instance.new("CFrameValue")
- Part8 = Instance.new("Part")
- Weld9 = Instance.new("Weld")
- CFrameValue10 = Instance.new("CFrameValue")
- Part11 = Instance.new("Part")
- Weld12 = Instance.new("Weld")
- CFrameValue13 = Instance.new("CFrameValue")
- Part14 = Instance.new("Part")
- Weld15 = Instance.new("Weld")
- CFrameValue16 = Instance.new("CFrameValue")
- Part17 = Instance.new("Part")
- Weld18 = Instance.new("Weld")
- CFrameValue19 = Instance.new("CFrameValue")
- Model0.Name = "scooper"
- Model0.Parent = mas
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-28.9927673, 2.19209909, 5.91230297, 0.999999702, 4.94616907e-05, -0.000781218871, -6.83548496e-05, 0.999707043, -0.0242027212, 0.000779792899, 0.0242027678, 0.999706745)
- Part1.Orientation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part1.Position = Vector3.new(-28.9927673, 2.19209909, 5.91230297)
- Part1.Rotation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Size = Vector3.new(0.5, 0.5, 1.25)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Dark stone grey")
- Part2.Parent = Model0
- Part2.CFrame = CFrame.new(-28.9918785, 1.86806905, 4.74309731, 0.999999702, 0.000313671189, -0.000717188814, -6.83548496e-05, 0.947695255, 0.319176555, 0.000779792899, -0.319176465, 0.947695017)
- Part2.Orientation = Vector3.new(-18.6100006, -0.0399999991, 0)
- Part2.Position = Vector3.new(-28.9918785, 1.86806905, 4.74309731)
- Part2.Rotation = Vector3.new(-18.6100006, -0.0399999991, -0.0199999996)
- Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part2.Size = Vector3.new(0.5, 0.5, 1.45000017)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.BrickColor = BrickColor.new("Dark stone grey")
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.brickColor = BrickColor.new("Dark stone grey")
- Weld3.Name = "qCFrameWeldThingy"
- Weld3.Parent = Part2
- Weld3.C1 = CFrame.new(0, -0.0661015511, 1.21147394, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736)
- Weld3.Part0 = Part1
- Weld3.Part1 = Part2
- Weld3.part1 = Part2
- CFrameValue4.Name = "qRelativeCFrameWeldValue"
- CFrameValue4.Parent = Part2
- CFrameValue4.Value = CFrame.new(0, -0.0661015511, 1.21147394, 1, 0, 0, 0, 0.939692736, -0.342019916, 0, 0.342019886, 0.939692736)
- Part5.Parent = Model0
- Part5.CFrame = CFrame.new(-28.9912262, 1.62797928, 3.88532567, 0.999999702, 4.94617125e-05, -0.000781218871, -6.83548496e-05, 0.999707043, -0.024202751, 0.000779792899, 0.024202738, 0.999706745)
- Part5.Orientation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part5.Position = Vector3.new(-28.9912262, 1.62797928, 3.88532567)
- Part5.Rotation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part5.Size = Vector3.new(0.5, 0.5, 0.550000131)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.BrickColor = BrickColor.new("Dark stone grey")
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.brickColor = BrickColor.new("Dark stone grey")
- Weld6.Name = "qCFrameWeldThingy"
- Weld6.Parent = Part5
- Weld6.C1 = CFrame.new(0, 0.613013029, 2.01273108, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1)
- Weld6.Part0 = Part1
- Weld6.Part1 = Part5
- Weld6.part1 = Part5
- CFrameValue7.Name = "qRelativeCFrameWeldValue"
- CFrameValue7.Parent = Part5
- CFrameValue7.Value = CFrame.new(0, 0.613013029, 2.01273108, 1, 0, 0, 0, 1, -2.98023224e-08, 0, -2.98023224e-08, 1)
- Part8.Parent = Model0
- Part8.CFrame = CFrame.new(-28.9918423, 2.57232952, 4.76014853, 0.999999702, -0.000220713613, -0.000751022599, -6.83548496e-05, 0.931139588, -0.364662826, 0.000779792899, 0.364662766, 0.93113935)
- Part8.Orientation = Vector3.new(21.3899994, -0.0500000007, 0)
- Part8.Position = Vector3.new(-28.9918423, 2.57232952, 4.76014853)
- Part8.Rotation = Vector3.new(21.3899994, -0.0399999991, 0.00999999978)
- Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part8.Size = Vector3.new(0.5, 0.5, 1.44999981)
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.BrickColor = BrickColor.new("Dark stone grey")
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.brickColor = BrickColor.new("Dark stone grey")
- Weld9.Name = "qCFrameWeldThingy"
- Weld9.Parent = Part8
- Weld9.C1 = CFrame.new(0, 0.066100359, 1.21147299, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736)
- Weld9.Part0 = Part1
- Weld9.Part1 = Part8
- Weld9.part1 = Part8
- CFrameValue10.Name = "qRelativeCFrameWeldValue"
- CFrameValue10.Parent = Part8
- CFrameValue10.Value = CFrame.new(0, 0.066100359, 1.21147299, 1, 0, 0, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736)
- Part11.Parent = Model0
- Part11.CFrame = CFrame.new(-28.9911652, 2.82762766, 3.91436911, 0.999999702, 4.94616907e-05, -0.000781218871, -6.83548496e-05, 0.999707043, -0.0242027212, 0.000779792899, 0.0242027678, 0.999706745)
- Part11.Orientation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part11.Position = Vector3.new(-28.9911652, 2.82762766, 3.91436911)
- Part11.Rotation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part11.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part11.Size = Vector3.new(0.5, 0.5, 0.550000131)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.BrickColor = BrickColor.new("Dark stone grey")
- Part11.TopSurface = Enum.SurfaceType.Smooth
- Part11.brickColor = BrickColor.new("Dark stone grey")
- Weld12.Name = "qCFrameWeldThingy"
- Weld12.Parent = Part11
- Weld12.C1 = CFrame.new(0, -0.586986959, 2.01273108, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld12.Part0 = Part1
- Weld12.Part1 = Part11
- Weld12.part1 = Part11
- CFrameValue13.Name = "qRelativeCFrameWeldValue"
- CFrameValue13.Parent = Part11
- CFrameValue13.Value = CFrame.new(0, -0.586986959, 2.01273108, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part14.Name = "torso"
- Part14.Parent = Model0
- Part14.CFrame = CFrame.new(-28.9932442, 2.42689896, 6.54316998, 0.999999702, 4.94616907e-05, -0.000781218871, -6.83548496e-05, 0.999707043, -0.0242027212, 0.000779792899, 0.0242027678, 0.999706745)
- Part14.Orientation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part14.Position = Vector3.new(-28.9932442, 2.42689896, 6.54316998)
- Part14.Rotation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part14.Transparency = 1
- Part14.Size = Vector3.new(2, 2, 1)
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.TopSurface = Enum.SurfaceType.Smooth
- Weld15.Name = "qCFrameWeldThingy"
- Weld15.Parent = Part14
- Weld15.C1 = CFrame.new(0, -0.249999821, -0.624999523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld15.Part0 = Part1
- Weld15.Part1 = Part14
- Weld15.part1 = Part14
- CFrameValue16.Name = "qRelativeCFrameWeldValue"
- CFrameValue16.Parent = Part14
- CFrameValue16.Value = CFrame.new(0, -0.249999821, -0.624999523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part17.Name = "norso"
- Part17.Parent = Model0
- Part17.CFrame = CFrame.new(-28.9911556, 2.22901344, 3.84986162, 0.999999702, 4.94616907e-05, -0.000781218871, -6.83548496e-05, 0.999707043, -0.0242027212, 0.000779792899, 0.0242027678, 0.999706745)
- Part17.Orientation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part17.Position = Vector3.new(-28.9911556, 2.22901344, 3.84986162)
- Part17.Rotation = Vector3.new(1.38999999, -0.0399999991, 0)
- Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part17.Transparency = 1
- Part17.Size = Vector3.new(0.5, 1.70000029, 0.650000155)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.BrickColor = BrickColor.new("Dark stone grey")
- Part17.CanCollide = false
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.brickColor = BrickColor.new("Dark stone grey")
- Weld18.Name = "qCFrameWeldThingy"
- Weld18.Parent = Part17
- Weld18.C1 = CFrame.new(0, 0.0130130649, 2.06273127, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld18.Part0 = Part1
- Weld18.Part1 = Part17
- Weld18.part1 = Part17
- CFrameValue19.Name = "qRelativeCFrameWeldValue"
- CFrameValue19.Parent = Part17
- CFrameValue19.Value = CFrame.new(0, 0.0130130649, 2.06273127, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- weldpart = Part14
- hitpart = Part17
- weldpartweld = Instance.new("Weld",weldpart)
- weldpartweld.Part0 = char.Torso
- weldpartweld.Part1 = weldpart
- weldpart.CanCollide = false
- scooper = Model0
- function scoop(charx)
- charx:FindFirstChildOfClass("Humanoid").PlatformStand = true
- for i,v in pairs(charx:GetDescendants()) do
- if v.ClassName == "Decal" or v.ClassName == "Texture" then
- v:Destroy()
- end
- end
- for i,v in pairs(charx:GetDescendants()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" then
- if v.Name ~= "Torso" and v.Name ~= "Head" and v.Name ~= "HumanoidRootPart" and v.Name ~= "UpperTorso" then
- v:Destroy()
- end
- end
- end
- for i,v in pairs(charx:GetDescendants()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" then
- v.Size = Vector3.new(0,0,0)
- v.Transparency = 1
- v.Anchored = false
- v.CFrame = mas.CFrame
- v.Massless = true
- local cf = mas.CFrame
- vweld = Instance.new("Weld",v)
- vweld.Part0 = mas
- vweld.Part1 = v
- --mas.CFrame = cf
- end
- end
- end
- hitpart.Touched:Connect(function(part)
- if scooping == true then
- if part.Parent:FindFirstChildOfClass("Humanoid") then
- wait(1)
- scoop(part.Parent)
- end
- end
- end)
- for i,v in pairs(scooper:GetChildren()) do
- v.Transparency = 1
- v.CanCollide = false
- v.Massless = true
- end
- mouse = player:GetMouse()
- scooping = false
- mouse.Button1Down:Connect(function()
- if scooping == false then
- scooping = true
- for i,v in pairs(scooper:GetChildren()) do
- if v ~= weldpart and v ~= hitpart then
- v.Transparency = 0
- v.CanCollide = true
- end
- end
- wait(1)
- for i,v in pairs(scooper:GetChildren()) do
- v.Transparency = 1
- v.CanCollide = false
- end
- scooping = false
- end
- end)
Add Comment
Please, Sign In to add comment