Advertisement
YukkoAioi

cute cuddly cat script

Oct 13th, 2017
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.06 KB | None | 0 0
  1. --TEM667TEMMIE
  2. --this is a cute cat
  3. --Converted with ttyyuu12345's model to script plugin v4
  4. function sandbox(var,func)
  5. local env = getfenv(func)
  6. local newenv = setmetatable({},{
  7. __index = function(self,k)
  8. if k=="script" then
  9. return var
  10. else
  11. return env[k]
  12. end
  13. end,
  14. })
  15. setfenv(func,newenv)
  16. return func
  17. end
  18. cors = {}
  19. mas = Instance.new("Model",game:GetService("Lighting"))
  20. Tool0 = Instance.new("Tool")
  21. Part1 = Instance.new("Part")
  22. SpecialMesh2 = Instance.new("SpecialMesh")
  23. LocalScript3 = Instance.new("LocalScript")
  24. Script4 = Instance.new("Script")
  25. Script5 = Instance.new("Script")
  26. LocalScript6 = Instance.new("LocalScript")
  27. Tool0.Name = "CompanionLOLcat"
  28. Tool0.Parent = mas
  29. Tool0.TextureId = "http://www.roblox.com/asset/?id=319323891"
  30. Tool0.GripPos = Vector3.new(4.25, 1.35000002, -1)
  31. Part1.Name = "Handle"
  32. Part1.Parent = Tool0
  33. Part1.Rotation = Vector3.new(-169.98999, 82.159996, 170.080002)
  34. Part1.Locked = true
  35. Part1.FormFactor = Enum.FormFactor.Custom
  36. Part1.Size = Vector3.new(1, 2, 4)
  37. Part1.CFrame = CFrame.new(-6.20698166, 2.31383038, -12.8086195, -0.134318948, -0.0234867707, 0.990659833, -1.38614045e-14, 0.999719083, 0.0237015504, -0.990938187, 0.00318356743, -0.134281218)
  38. Part1.BottomSurface = Enum.SurfaceType.Smooth
  39. Part1.TopSurface = Enum.SurfaceType.Smooth
  40. Part1.Position = Vector3.new(-6.20698166, 2.31383038, -12.8086195)
  41. Part1.Orientation = Vector3.new(-1.36000001, 97.7200012, 0)
  42. SpecialMesh2.Parent = Part1
  43. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=319323837"
  44. SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
  45. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=319323867"
  46. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  47. SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
  48. LocalScript3.Name = "MouseIcon"
  49. LocalScript3.Parent = Tool0
  50. table.insert(cors,sandbox(LocalScript3,function()
  51. --Made by Luckymaxer
  52.  
  53. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  54. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  55.  
  56. Tool = script.Parent
  57.  
  58. Mouse = nil
  59.  
  60. function UpdateIcon()
  61. if Mouse then
  62. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  63. end
  64. end
  65.  
  66. function OnEquipped(ToolMouse)
  67. Mouse = ToolMouse
  68. UpdateIcon()
  69. end
  70.  
  71. function OnChanged(Property)
  72. if Property == "Enabled" then
  73. UpdateIcon()
  74. end
  75. end
  76.  
  77. Tool.Equipped:connect(OnEquipped)
  78. Tool.Changed:connect(OnChanged)
  79. end))
  80. Script4.Parent = Tool0
  81. table.insert(cors,sandbox(Script4,function()
  82. --Made by Luckymaxer
  83.  
  84. Tool = script.Parent
  85. Handle = Tool:WaitForChild("Handle")
  86.  
  87. Players = game:GetService("Players")
  88. Debris = game:GetService("Debris")
  89. InsertService = game:GetService("InsertService")
  90.  
  91. Remover = script:WaitForChild("Remover")
  92.  
  93. NPCModule = require(191816425)
  94.  
  95. ReloadTime = 5
  96.  
  97. NPCSpawned = false
  98. ToolEquipped = false
  99.  
  100. ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
  101. ServerControl.Name = "ServerControl"
  102. ServerControl.Parent = Tool
  103.  
  104. ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
  105. ClientControl.Name = "ClientControl"
  106. ClientControl.Parent = Tool
  107.  
  108. Handle.Transparency = 0
  109. Tool.Enabled = true
  110.  
  111. function IsTeamMate(Player1, Player2)
  112. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  113. end
  114.  
  115. function MakeNPC()
  116. if PlayerNPC and PlayerNPC.Parent then
  117. PlayerNPC:Destroy()
  118. end
  119. PlayerNPC = NPC:Clone()
  120. NPCHumanoid = PlayerNPC:FindFirstChild("Humanoid")
  121. NPCTorso = PlayerNPC:FindFirstChild("Torso")
  122. NPCFunctions.MakeNPC({NPC = PlayerNPC, AIControl = {
  123. Creator = Player,
  124. Mode = "Follow",
  125. MaxDistance = 100,
  126. Follow = Player,
  127. Offset = Vector3.new(4.5, 0, -1.5),
  128. GeneralOffset = false,
  129. Chase = true,
  130. ChaseDistance = 50,
  131. ChaseRange = 0,
  132. Target = nil,
  133. TargetPos = Vector3.new(0, 0, 0),
  134. Damage = 0,
  135. SelfSufficient = false
  136. }})
  137. local Values = {
  138. {Name = "Creator", Class = "ObjectValue", Value = Player},
  139. {Name = "Tool", Class = "ObjectValue", Value = Tool},
  140. }
  141. for i, v in pairs(Values) do
  142. local Value = Instance.new(v.Class)
  143. Value.Name = v.Name
  144. Value.Value = v.Value
  145. Value.Parent = PlayerNPC
  146. end
  147. if not NPCHumanoid or not NPCTorso then
  148. return
  149. end
  150. for i, v in pairs({Remover}) do
  151. local ScriptClone = v:Clone()
  152. ScriptClone.Disabled = false
  153. ScriptClone.Parent = PlayerNPC
  154. end
  155. NPCHumanoid.Died:connect(function()
  156. Debris:AddItem(PlayerNPC, 3)
  157. end)
  158. PlayerNPC.Changed:connect(function(Property)
  159. if Property == "Parent" and not PlayerNPC.Parent and NPCSpawned then
  160. Tool.Enabled = false
  161. NPCSpawned = false
  162. wait(ReloadTime)
  163. Tool.Enabled = true
  164. end
  165. end)
  166. NPCTorso.CFrame = (Torso.CFrame * CFrame.new(PlayerNPC.Offset.Value))
  167. PlayerNPC.Parent = game:GetService("Workspace")
  168. NPCHumanoid:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
  169. NPCSpawned = true
  170. end
  171.  
  172. function SetTarget(Data)
  173. if not PlayerNPC or not PlayerNPC.Parent then
  174. return
  175. end
  176. local MousePosition = Data.MousePosition
  177. local Target = Data.Target
  178. local TargetValue = PlayerNPC:FindFirstChild("Target")
  179. local TargetPosValue = PlayerNPC:FindFirstChild("TargetPos")
  180. local ModeValue = PlayerNPC:FindFirstChild("Mode")
  181. local OffsetValue = PlayerNPC:FindFirstChild("Offset")
  182. if not TargetValue or not TargetPosValue or not ModeValue then
  183. return
  184. end
  185. if Target and Target.Parent then
  186. local character = Target.Parent
  187. if character:IsA("Hat") then
  188. character = character.Parent
  189. end
  190. local player = Players:GetPlayerFromCharacter(character)
  191. if player and IsTeamMate(player, Player) then
  192. return
  193. end
  194. local creator = character:FindFirstChild("Creator")
  195. local humanoid = character:FindFirstChild("Humanoid")
  196. if creator and (creator.Value == Player or IsTeamMate(Player, creator.Value)) then
  197. return
  198. end
  199. if humanoid and humanoid.Health > 0 then
  200. if TargetValue then
  201. TargetValue.Value = character
  202. ModeValue.Value = "Attack"
  203. return
  204. end
  205. else
  206. TargetPosValue.Value = MousePosition
  207. TargetValue.Value = nil
  208. ModeValue.Value = "MoveTo"
  209. end
  210. else
  211. ModeValue.Value = "Follow"
  212. end
  213. end
  214.  
  215. function Activated()
  216. if not ToolEquipped or not CheckIfAlive() then
  217. return
  218. end
  219. if Tool.Enabled and (not PlayerNPC or not PlayerNPC.Parent) then
  220. else
  221. local MouseData = InvokeClient("MouseData")
  222. if not MouseData then
  223. return
  224. end
  225. local MousePosition = MouseData.Position
  226. local Target = MouseData.Target
  227. SetTarget({MousePosition = MousePosition, Target = Target})
  228. end
  229. end
  230.  
  231. function CheckIfAlive()
  232. return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
  233. end
  234.  
  235. function Equipped()
  236. Handle.Transparency = 1
  237. Character = Tool.Parent
  238. Player = Players:GetPlayerFromCharacter(Character)
  239. Humanoid = Character:FindFirstChild("Humanoid")
  240. Torso = Character:FindFirstChild("Torso")
  241. if not CheckIfAlive() then
  242. return
  243. end
  244. ToolEquipped = true
  245. end
  246.  
  247. function Unequipped()
  248. ToolEquipped = false
  249. end
  250.  
  251. function InvokeClient(Mode, Value)
  252. local ClientReturn = nil
  253. pcall(function()
  254. ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
  255. end)
  256. return ClientReturn
  257. end
  258.  
  259. ServerControl.OnServerInvoke = (function(player, Mode, Value)
  260. if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
  261. return
  262. end
  263. end)
  264.  
  265. Tool.Changed:connect(function(Property)
  266. if not Tool.Parent then
  267. return
  268. end
  269. Spawn(function()
  270. if not Tool.Enabled or NPCSpawned or not ToolEquipped or not CheckIfAlive() then
  271. return
  272. end
  273. NPCData = NPCModule.GetTable({Key = "MakeNPC", Player = Player})
  274. NPCFunctions = NPCData.GetData({Player = Player, Tool = Tool})
  275. LOLcatData = NPCModule.GetTable({Key = "LOLcat", Player = Player})
  276. if not LOLcatData then
  277. return
  278. end
  279. LOLcatFunctions = LOLcatData.GetData({Player = Player, Tool = Tool, Character = Character})
  280. if not LOLcatFunctions then
  281. return
  282. end
  283. NPC = LOLcatFunctions.CreateCat()
  284. Spawn(MakeNPC)
  285. end)
  286. Handle.Transparency = ((Players:GetPlayerFromCharacter(Tool.Parent) and ((not NPCSpawned and 1) or 0)) or 0)
  287. end)
  288.  
  289. Tool.Activated:connect(Activated)
  290. Tool.Equipped:connect(Equipped)
  291. Tool.Unequipped:connect(Unequipped)
  292. end))
  293. Script5.Name = "Remover"
  294. Script5.Parent = Script4
  295. Script5.Disabled = true
  296. table.insert(cors,sandbox(Script5,function()
  297. --Made by Luckymaxer
  298.  
  299. Model = script.Parent
  300.  
  301. Players = game:GetService("Players")
  302. Debris = game:GetService("Debris")
  303.  
  304. Creator = Model:FindFirstChild("Creator")
  305. Tool = Model:FindFirstChild("Tool")
  306.  
  307. function DestroyModel()
  308. Debris:AddItem(Model, 0.5)
  309. end
  310.  
  311. if not Creator or not Creator.Value or not Creator.Value:IsA("Player") or not Creator.Value.Parent or not Tool or not Tool.Value or not Tool.Value.Parent then
  312. DestroyModel()
  313. return
  314. end
  315.  
  316. Creator = Creator.Value
  317. Tool = Tool.Value
  318.  
  319. Character = Creator.Character
  320. if not Character then
  321. DestroyModel()
  322. return
  323. end
  324.  
  325. Creator.Changed:connect(function(Property)
  326. if Property == "Parent" and not Creator.Parent then
  327. DestroyModel()
  328. end
  329. end)
  330.  
  331. Character.Changed:connect(function(Property)
  332. if Property == "Parent" and not Character.Parent then
  333. DestroyModel()
  334. end
  335. end)
  336.  
  337. Tool.Changed:connect(function(Property)
  338. if Property == "Parent" and (not Tool.Parent or (not Tool.Parent:IsA("Backpack") and not Players:GetPlayerFromCharacter(Tool.Parent))) then
  339. DestroyModel()
  340. end
  341. end)
  342. end))
  343. LocalScript6.Parent = Tool0
  344. table.insert(cors,sandbox(LocalScript6,function()
  345. --Made by Luckymaxer
  346.  
  347. Tool = script.Parent
  348. Handle = Tool:WaitForChild("Handle")
  349.  
  350. Players = game:GetService("Players")
  351. RunService = game:GetService("RunService")
  352. UserInputService = game:GetService("UserInputService")
  353.  
  354. Animations = {}
  355.  
  356. ServerControl = Tool:WaitForChild("ServerControl")
  357. ClientControl = Tool:WaitForChild("ClientControl")
  358.  
  359. Rate = (1 / 60)
  360.  
  361. ToolEquipped = false
  362.  
  363. function SetAnimation(mode, value)
  364. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  365. for i, v in pairs(Animations) do
  366. if v.Animation == value.Animation then
  367. v.AnimationTrack:Stop()
  368. table.remove(Animations, i)
  369. end
  370. end
  371. local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
  372. table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
  373. AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
  374. elseif mode == "StopAnimation" and value then
  375. for i, v in pairs(Animations) do
  376. if v.Animation == value.Animation then
  377. v.AnimationTrack:Stop(value.FadeTime)
  378. table.remove(Animations, i)
  379. end
  380. end
  381. end
  382. end
  383.  
  384. function CheckIfAlive()
  385. return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
  386. end
  387.  
  388. function Equipped(Mouse)
  389. Character = Tool.Parent
  390. Player = Players:GetPlayerFromCharacter(Character)
  391. Humanoid = Character:FindFirstChild("Humanoid")
  392. ToolEquipped = true
  393. if not CheckIfAlive() then
  394. return
  395. end
  396. PlayerMouse = Player:GetMouse()
  397. end
  398.  
  399. function Unequipped()
  400. for i, v in pairs(Animations) do
  401. if v and v.AnimationTrack then
  402. v.AnimationTrack:Stop()
  403. end
  404. end
  405. Animations = {}
  406. ToolEquipped = false
  407. end
  408.  
  409. function InvokeServer(mode, value)
  410. local ServerReturn
  411. pcall(function()
  412. ServerReturn = ServerControl:InvokeServer(mode, value)
  413. end)
  414. return ServerReturn
  415. end
  416.  
  417. function OnClientInvoke(mode, value)
  418. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  419. SetAnimation("PlayAnimation", value)
  420. elseif mode == "StopAnimation" and value then
  421. SetAnimation("StopAnimation", value)
  422. elseif mode == "MouseData" then
  423. return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil)
  424. end
  425. end
  426.  
  427. ClientControl.OnClientInvoke = OnClientInvoke
  428. Tool.Equipped:connect(Equipped)
  429. Tool.Unequipped:connect(Unequipped)
  430. end))
  431. for i,v in pairs(mas:GetChildren()) do
  432. v.Parent = workspace
  433. pcall(function() v:MakeJoints() end)
  434. end
  435. mas:Destroy()
  436. for i,v in pairs(cors) do
  437. spawn(function()
  438. pcall(v)
  439. end)
  440. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement