Advertisement
zXzGamePROzXz

Shopping cart

Jan 12th, 2019
1,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87.  
  88. --By Rufus14
  89. rig = game.Players.zXzGamePROzXz.Character.Torso
  90. game.Players.zXzGamePROzXz.Character.Animate:destroy()
  91. run = Instance.new("Sound", game.Players.zXzGamePROzXz.Character.Head)
  92. run.SoundId = "rbxassetid://142665235"
  93. run.Volume = 0
  94. run.Looped = true
  95. run:Play()
  96. run.PlaybackSpeed = 1.2
  97. print(rig["Left Hip"].C0)
  98. print(rig["Right Hip"].C0)
  99. cart = Instance.new("Part", rig)
  100. cart.CanCollide = false
  101. weld = Instance.new("Weld", cart)
  102. weld.Part0 = cart
  103. weld.Part1 = rig
  104. mesh = Instance.new("SpecialMesh", cart)
  105. mesh.MeshId = "rbxassetid://552693518"
  106. mesh.TextureId = "rbxassetid://552693524"
  107. mesh.Scale = Vector3.new(7.2,7,8)
  108. weld.C0 = weld.C0 * CFrame.new(0,1,4.2)
  109. walking = true
  110. game.Players.zXzGamePROzXz.Character.Humanoid.WalkSpeed = 25
  111. for i = 1,20 do
  112. wait()
  113. rig["Left Shoulder"].C0 = rig["Left Shoulder"].C0 * CFrame.Angles(0,0,-0.08)
  114. rig["Right Shoulder"].C0 = rig["Right Shoulder"].C0 * CFrame.Angles(0,0,0.08)
  115. end
  116. function walk(key)
  117. key = key:lower()
  118. if key == "w" then
  119. walking = true
  120. run.Volume = 10
  121. if walking == true then
  122. wait()
  123. for i = 1,5 do
  124. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  125. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  126. end
  127. while walking == true do
  128. for i = 1,5 do
  129. wait()
  130. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  131. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  132. end
  133. for i = 1,5 do
  134. wait()
  135. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  136. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  137. end
  138. end
  139. end
  140. end
  141. end
  142. mouse.KeyDown:connect(walk)
  143. function notwalk(key)
  144. key = key:lower()
  145. if key == "w" then
  146. walking = false
  147. run.Volume = 0
  148. for i = 1,10 do
  149. wait()
  150. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  151. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  152. end
  153. end
  154. end
  155. mouse.KeyUp:connect(notwalk)
  156. ---------------------------------
  157. walking1 = false
  158. function walk1(key)
  159. key = key:lower()
  160. if key == "d" then
  161. walking1 = true
  162. if walking1 == true then
  163. wait()
  164. run.Volume = 10
  165. for i = 1,5 do
  166. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  167. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  168. end
  169. while walking1 == true do
  170. for i = 1,5 do
  171. wait()
  172. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  173. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  174. end
  175. for i = 1,5 do
  176. wait()
  177. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  178. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  179. end
  180. end
  181. end
  182. end
  183. end
  184. mouse.KeyDown:connect(walk1)
  185. function notwalk1(key)
  186. key = key:lower()
  187. if key == "d" then
  188. walking1 = false
  189. run.Volume = 0
  190. for i = 1,10 do
  191. wait()
  192. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  193. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  194. end
  195. end
  196. end
  197. mouse.KeyUp:connect(notwalk1)
  198. ------------------------------------------
  199. walking2 = false
  200. function walk2(key)
  201. key = key:lower()
  202. if key == "a" then
  203. walking2 = true
  204. run.Volume = 10
  205. if walking2 == true then
  206. wait()
  207. for i = 1,5 do
  208. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  209. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  210. end
  211. while walking2 == true do
  212. for i = 1,5 do
  213. wait()
  214. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  215. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  216. end
  217. for i = 1,5 do
  218. wait()
  219. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  220. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  221. end
  222. end
  223. end
  224. end
  225. end
  226. mouse.KeyDown:connect(walk2)
  227. function notwalk2(key)
  228. key = key:lower()
  229. if key == "a" then
  230. walking2 = false
  231. run.Volume = 0
  232. for i = 1,10 do
  233. wait()
  234. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  235. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  236. end
  237. end
  238. end
  239. mouse.KeyUp:connect(notwalk2)
  240. ----------------------------------------------------
  241. walking3 = false
  242. function walk3(key)
  243. key = key:lower()
  244. if key == "s" then
  245. walking3 = true
  246. run.Volume = 10
  247. if walking3 == true then
  248. wait()
  249. for i = 1,5 do
  250. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  251. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  252. end
  253. while walking3 == true do
  254. for i = 1,5 do
  255. wait()
  256. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  257. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  258. end
  259. for i = 1,5 do
  260. wait()
  261. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  262. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  263. end
  264. end
  265. end
  266. end
  267. end
  268. mouse.KeyDown:connect(walk3)
  269. function notwalk3(key)
  270. key = key:lower()
  271. if key == "s" then
  272. walking3 = false
  273. run.Volume = 0
  274. for i = 1,10 do
  275. wait()
  276. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  277. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  278. end
  279. end
  280. end
  281. mouse.KeyUp:connect(notwalk3)
  282. grabbing = true
  283. function grab1(cart1)
  284. if grabbing == true then
  285. local torso = cart1.Parent:findFirstChild("Torso")
  286. if torso ~= nil then
  287. local hum = cart1.Parent:findFirstChild("Humanoid")
  288. if hum ~= nil then
  289. hum.PlatformStand = true
  290. local weld1 = Instance.new("Weld", torso)
  291. weld1.Part0 = torso
  292. weld1.Part1 = cart
  293. weld1.C0 = weld1.C0 * CFrame.Angles(-8,0,1.2) * CFrame.new(0,-1.4,0)
  294. end
  295. end
  296. end
  297. end
  298. cart.Touched:connect(grab1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement