Advertisement
Void_scripter0

Shopping cart

Mar 17th, 2019
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.56 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  2. do
  3. script.Parent = owner.Character
  4. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5. local function NewFakeEvent()
  6. local Bind = Instance.new("BindableEvent")
  7. local Fake;Fake = {Connections = {},
  8. fakeEvent=true;
  9. Connect=function(self,Func)
  10. Bind.Event:connect(Func)
  11. self.Connections[Bind] = true
  12. return setmetatable({Connected = true},{
  13. __index = function (self,Index)
  14. if Index:lower() == "disconnect" then
  15. return function() Fake.Connections[Bind] = false;self.Connected = false end
  16. end
  17. return Fake[Index]
  18. end;
  19. __tostring = function() return "Connection" end;
  20. })
  21. end}
  22. Fake.connect = Fake.Connect;return Fake;
  23. end
  24. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  25. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  26. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  27. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  28. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  29. local function TriggerEvent(self,Event,...)
  30. local Trigger = Mouse[Event]
  31. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  32. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  33. end
  34. end
  35. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  36. Event.OnServerEvent:Connect(function(FiredBy,Input)
  37. if FiredBy.Name ~= owner.Name then return end
  38. if Input.MouseEvent then
  39. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  40. else
  41. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  42. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  43. for _,Action in pairs(ContextActionService.Actions) do
  44. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  45. end
  46. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  47. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  48. end
  49. end)
  50. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  51. Event.Parent = NLS([[
  52. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  53. local Input = function(Input,gameProcessedEvent)
  54. if gameProcessedEvent then return end
  55. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56. end
  57. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  58. local Hit,Target
  59. while wait(1/30) do
  60. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  61. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  62. end
  63. end
  64. ]],owner.Character)
  65. end
  66. RealGame = game;game = setmetatable({},{
  67. __index = function (self,Index)
  68. local Sandbox = function (Thing)
  69. if Thing:IsA("Player") then
  70. local RealPlayer = Thing
  71. return setmetatable({},{
  72. __index = function (self,Index)
  73. local Type = type(RealPlayer[Index])
  74. if Type == "function" then
  75. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  76. return function (self)return InternalData["Mouse"] end
  77. end
  78. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  79. end
  80. return RealPlayer[Index]
  81. end;
  82. __tostring = function(self) return RealPlayer.Name end
  83. })
  84. end
  85. end
  86. if RealGame[Index] then
  87. local Type = type(RealGame[Index])
  88. if Type == "function" then
  89. if Index:lower() == "getservice" or Index:lower() == "service" then
  90. return function (self,Service)
  91. local FakeServices = {
  92. ["players"] = function()
  93. return setmetatable({},{
  94. __index = function (self2,Index2)
  95. local RealService = RealGame:GetService(Service)
  96. local Type2 = type(Index2)
  97. if Type2 == "function" then
  98. return function (self,...) return RealService[Index2](RealService,...)end
  99. else
  100. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  101. return RealService[Index2]
  102. end
  103. end;
  104. __tostring = function(self) return RealGame:GetService(Service).Name end
  105. })
  106. end;
  107. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  108. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  109. ["runservice"] = function()
  110. return setmetatable({},{
  111. __index = function(self2,Index2)
  112. local RealService = RealGame:GetService(Service)
  113. local Type2 = type(Index2)
  114. if Type2 == "function" then
  115. return function (self,...) return RealService[Index2](RealService,...) end
  116. else
  117. local RunServices = {
  118. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  119. ["renderstepped"] = function() return RealService["Stepped"] end
  120. }
  121. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  122. return RealService[Index2]
  123. end
  124. end
  125. })
  126. end
  127. }
  128. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  129. return RealGame:GetService(Service)
  130. end
  131. end
  132. return function (self,...) return RealGame[Index](RealGame,...) end
  133. else
  134. if game:GetService(Index) then return game:GetService(Index) end
  135. return RealGame[Index]
  136. end
  137. end
  138. return nil
  139. end
  140. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  141. --By Rufus14
  142. mouse = game.Players.LocalPlayer:GetMouse()
  143. rig = game.Players.LocalPlayer.Character.Torso
  144. game.Players.LocalPlayer.Character.Animate:destroy()
  145. run = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  146. run.SoundId = "rbxassetid://142665235"
  147. run.Volume = 0
  148. run.Looped = true
  149. run:Play()
  150. run.PlaybackSpeed = 1.2
  151. print(rig["Left Hip"].C0)
  152. print(rig["Right Hip"].C0)
  153. cart = Instance.new("Part", rig)
  154. cart.CanCollide = false
  155. weld = Instance.new("Weld", cart)
  156. weld.Part0 = cart
  157. weld.Part1 = rig
  158. mesh = Instance.new("SpecialMesh", cart)
  159. mesh.MeshId = "rbxassetid://552693518"
  160. mesh.TextureId = "rbxassetid://552693524"
  161. mesh.Scale = Vector3.new(7.2,7,8)
  162. weld.C0 = weld.C0 * CFrame.new(0,1,4.2)
  163. walking = true
  164. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
  165. for i = 1,20 do
  166. wait()
  167. rig["Left Shoulder"].C0 = rig["Left Shoulder"].C0 * CFrame.Angles(0,0,-0.08)
  168. rig["Right Shoulder"].C0 = rig["Right Shoulder"].C0 * CFrame.Angles(0,0,0.08)
  169. end
  170. function walk(key)
  171. key = key:lower()
  172. if key == "w" then
  173. walking = true
  174. run.Volume = 10
  175. if walking == true then
  176. wait()
  177. for i = 1,5 do
  178. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  179. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  180. end
  181. while walking == true do
  182. for i = 1,5 do
  183. wait()
  184. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  185. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  186. end
  187. for i = 1,5 do
  188. wait()
  189. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  190. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  191. end
  192. end
  193. end
  194. end
  195. end
  196. mouse.KeyDown:connect(walk)
  197. function notwalk(key)
  198. key = key:lower()
  199. if key == "w" then
  200. walking = false
  201. run.Volume = 0
  202. for i = 1,10 do
  203. wait()
  204. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  205. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  206. end
  207. end
  208. end
  209. mouse.KeyUp:connect(notwalk)
  210. ---------------------------------
  211. walking1 = false
  212. function walk1(key)
  213. key = key:lower()
  214. if key == "d" then
  215. walking1 = true
  216. if walking1 == true then
  217. wait()
  218. run.Volume = 10
  219. for i = 1,5 do
  220. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  221. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  222. end
  223. while walking1 == true do
  224. for i = 1,5 do
  225. wait()
  226. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  227. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  228. end
  229. for i = 1,5 do
  230. wait()
  231. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  232. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  233. end
  234. end
  235. end
  236. end
  237. end
  238. mouse.KeyDown:connect(walk1)
  239. function notwalk1(key)
  240. key = key:lower()
  241. if key == "d" then
  242. walking1 = false
  243. run.Volume = 0
  244. for i = 1,10 do
  245. wait()
  246. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  247. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  248. end
  249. end
  250. end
  251. mouse.KeyUp:connect(notwalk1)
  252. ------------------------------------------
  253. walking2 = false
  254. function walk2(key)
  255. key = key:lower()
  256. if key == "a" then
  257. walking2 = true
  258. run.Volume = 10
  259. if walking2 == true then
  260. wait()
  261. for i = 1,5 do
  262. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  263. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  264. end
  265. while walking2 == true do
  266. for i = 1,5 do
  267. wait()
  268. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  269. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  270. end
  271. for i = 1,5 do
  272. wait()
  273. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  274. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  275. end
  276. end
  277. end
  278. end
  279. end
  280. mouse.KeyDown:connect(walk2)
  281. function notwalk2(key)
  282. key = key:lower()
  283. if key == "a" then
  284. walking2 = false
  285. run.Volume = 0
  286. for i = 1,10 do
  287. wait()
  288. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  289. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  290. end
  291. end
  292. end
  293. mouse.KeyUp:connect(notwalk2)
  294. ----------------------------------------------------
  295. walking3 = false
  296. function walk3(key)
  297. key = key:lower()
  298. if key == "s" then
  299. walking3 = true
  300. run.Volume = 10
  301. if walking3 == true then
  302. wait()
  303. for i = 1,5 do
  304. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  305. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  306. end
  307. while walking3 == true do
  308. for i = 1,5 do
  309. wait()
  310. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  311. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  312. end
  313. for i = 1,5 do
  314. wait()
  315. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  316. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  317. end
  318. end
  319. end
  320. end
  321. end
  322. mouse.KeyDown:connect(walk3)
  323. function notwalk3(key)
  324. key = key:lower()
  325. if key == "s" then
  326. walking3 = false
  327. run.Volume = 0
  328. for i = 1,10 do
  329. wait()
  330. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  331. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  332. end
  333. end
  334. end
  335. mouse.KeyUp:connect(notwalk3)
  336. grabbing = true
  337. function grab1(cart1)
  338. if grabbing == true then
  339. local torso = cart1.Parent:findFirstChild("Torso")
  340. if torso ~= nil then
  341. local hum = cart1.Parent:findFirstChild("Humanoid")
  342. if hum ~= nil then
  343. hum.PlatformStand = true
  344. local weld1 = Instance.new("Weld", torso)
  345. weld1.Part0 = torso
  346. weld1.Part1 = cart
  347. weld1.C0 = weld1.C0 * CFrame.Angles(-8,0,1.2) * CFrame.new(0,-1.4,0)
  348. end
  349. end
  350. end
  351. end
  352. cart.Touched:connect(grab1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement