Advertisement
PierceTheCakeKeeper

Rufus14 shopping cart FE

Jul 7th, 2019
473
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.  
  89.  
  90. --By Rufus14
  91. rig = owner.Character.Torso
  92. owner.Character.Animate:destroy()
  93. run = Instance.new("Sound", owner.Character.Head)
  94. run.SoundId = "rbxassetid://142665235"
  95. run.Volume = 0
  96. run.Looped = true
  97. run:Play()
  98. run.PlaybackSpeed = 1.2
  99. print(rig["Left Hip"].C0)
  100. print(rig["Right Hip"].C0)
  101. cart = Instance.new("Part", rig)
  102. cart.CanCollide = false
  103. weld = Instance.new("Weld", cart)
  104. weld.Part0 = cart
  105. weld.Part1 = rig
  106. mesh = Instance.new("SpecialMesh", cart)
  107. mesh.MeshId = "rbxassetid://552693518"
  108. mesh.TextureId = "rbxassetid://552693524"
  109. mesh.Scale = Vector3.new(7.2,7,8)
  110. weld.C0 = weld.C0 * CFrame.new(0,1,4.2)
  111. walking = true
  112. owner.Character.Humanoid.WalkSpeed = 25
  113. for i = 1,20 do
  114. wait()
  115. rig["Left Shoulder"].C0 = rig["Left Shoulder"].C0 * CFrame.Angles(0,0,-0.08)
  116. rig["Right Shoulder"].C0 = rig["Right Shoulder"].C0 * CFrame.Angles(0,0,0.08)
  117. end
  118. function walk(key)
  119. key = key:lower()
  120. if key == "w" then
  121. walking = true
  122. run.Volume = 10
  123. if walking == true then
  124. wait()
  125. for i = 1,5 do
  126. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  127. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  128. end
  129. while walking == true do
  130. for i = 1,5 do
  131. wait()
  132. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  133. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  134. end
  135. for i = 1,5 do
  136. wait()
  137. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  138. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  139. end
  140. end
  141. end
  142. end
  143. end
  144. mouse.KeyDown:connect(walk)
  145. function notwalk(key)
  146. key = key:lower()
  147. if key == "w" then
  148. walking = false
  149. run.Volume = 0
  150. for i = 1,10 do
  151. wait()
  152. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  153. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  154. end
  155. end
  156. end
  157. mouse.KeyUp:connect(notwalk)
  158. ---------------------------------
  159. walking1 = false
  160. function walk1(key)
  161. key = key:lower()
  162. if key == "d" then
  163. walking1 = true
  164. if walking1 == true then
  165. wait()
  166. run.Volume = 10
  167. for i = 1,5 do
  168. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  169. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  170. end
  171. while walking1 == true do
  172. for i = 1,5 do
  173. wait()
  174. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  175. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  176. end
  177. for i = 1,5 do
  178. wait()
  179. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  180. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  181. end
  182. end
  183. end
  184. end
  185. end
  186. mouse.KeyDown:connect(walk1)
  187. function notwalk1(key)
  188. key = key:lower()
  189. if key == "d" then
  190. walking1 = false
  191. run.Volume = 0
  192. for i = 1,10 do
  193. wait()
  194. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  195. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  196. end
  197. end
  198. end
  199. mouse.KeyUp:connect(notwalk1)
  200. ------------------------------------------
  201. walking2 = false
  202. function walk2(key)
  203. key = key:lower()
  204. if key == "a" then
  205. walking2 = true
  206. run.Volume = 10
  207. if walking2 == true then
  208. wait()
  209. for i = 1,5 do
  210. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  211. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  212. end
  213. while walking2 == true do
  214. for i = 1,5 do
  215. wait()
  216. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  217. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  218. end
  219. for i = 1,5 do
  220. wait()
  221. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  222. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  223. end
  224. end
  225. end
  226. end
  227. end
  228. mouse.KeyDown:connect(walk2)
  229. function notwalk2(key)
  230. key = key:lower()
  231. if key == "a" then
  232. walking2 = false
  233. run.Volume = 0
  234. for i = 1,10 do
  235. wait()
  236. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  237. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  238. end
  239. end
  240. end
  241. mouse.KeyUp:connect(notwalk2)
  242. ----------------------------------------------------
  243. walking3 = false
  244. function walk3(key)
  245. key = key:lower()
  246. if key == "s" then
  247. walking3 = true
  248. run.Volume = 10
  249. if walking3 == true then
  250. wait()
  251. for i = 1,5 do
  252. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.2)
  253. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.2)
  254. end
  255. while walking3 == true do
  256. for i = 1,5 do
  257. wait()
  258. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,0.4)
  259. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,0.4)
  260. end
  261. for i = 1,5 do
  262. wait()
  263. rig["Left Hip"].C0 = rig["Left Hip"].C0 * CFrame.Angles(0,0,-0.4)
  264. rig["Right Hip"].C0 = rig["Right Hip"].C0 * CFrame.Angles(0,0,-0.4)
  265. end
  266. end
  267. end
  268. end
  269. end
  270. mouse.KeyDown:connect(walk3)
  271. function notwalk3(key)
  272. key = key:lower()
  273. if key == "s" then
  274. walking3 = false
  275. run.Volume = 0
  276. for i = 1,10 do
  277. wait()
  278. rig["Left Hip"].C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  279. rig["Right Hip"].C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  280. end
  281. end
  282. end
  283. mouse.KeyUp:connect(notwalk3)
  284. grabbing = true
  285. function grab1(cart1)
  286. if grabbing == true then
  287. local torso = cart1.Parent:findFirstChild("Torso")
  288. if torso ~= nil then
  289. local hum = cart1.Parent:findFirstChild("Humanoid")
  290. if hum ~= nil then
  291. hum.PlatformStand = true
  292. local weld1 = Instance.new("Weld", torso)
  293. weld1.Part0 = torso
  294. weld1.Part1 = cart
  295. weld1.C0 = weld1.C0 * CFrame.Angles(-8,0,1.2) * CFrame.new(0,-1.4,0)
  296. end
  297. end
  298. end
  299. end
  300. cart.Touched:connect(grab1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement