GodzScript

Untitled

May 3rd, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.20 KB | Source Code | 0 0
  1. local function addHighlightWithDelay(model)
  2. wait(0.5)
  3. local newHighlight = Instance.new("Highlight")
  4. newHighlight.FillColor = Color3.fromRGB(128, 0, 128) -- you can change fill color
  5. newHighlight.Parent = model
  6.  
  7. local function showSpawnNotification()
  8. local player = game.Players.LocalPlayer
  9. local screenGui = Instance.new("ScreenGui")
  10. screenGui.Parent = player:WaitForChild("PlayerGui")
  11.  
  12. local textLabel = Instance.new("TextLabel")
  13. textLabel.Text = "PETAPETA spawned"
  14. textLabel.TextColor3 = Color3.new(1, 1, 1) -- White color
  15. textLabel.BackgroundTransparency = 1
  16. textLabel.Size = UDim2.new(0.3, 0, 0.1, 0)
  17. textLabel.Position = UDim2.new(0.35, 0, 0.9, 0)
  18. textLabel.Font = Enum.Font.SourceSans
  19. textLabel.TextScaled = true
  20. textLabel.Parent = screenGui
  21.  
  22. wait(5)
  23. local tweenService = game:GetService("TweenService")
  24. local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  25. local tween = tweenService:Create(textLabel, tweenInfo, {TextTransparency = 1})
  26. tween:Play()
  27.  
  28. tween.Completed:Connect(function()
  29. screenGui:Destroy()
  30. end)
  31. end
  32.  
  33. model.AncestryChanged:Connect(function(_, parent)
  34. if not parent then -- If model is destroyed
  35. local player = game.Players.LocalPlayer
  36. local screenGui = Instance.new("ScreenGui")
  37. screenGui.Parent = player:WaitForChild("PlayerGui")
  38.  
  39. local textLabel = Instance.new("TextLabel")
  40. textLabel.Text = "PETAPETA despawned"
  41. textLabel.TextColor3 = Color3.new(1, 1, 1) -- White color
  42. textLabel.BackgroundTransparency = 1
  43. textLabel.Size = UDim2.new(0.3, 0, 0.1, 0)
  44. textLabel.Position = UDim2.new(0.35, 0, 0.9, 0)
  45. textLabel.Font = Enum.Font.SourceSans
  46. textLabel.TextScaled = true
  47. textLabel.Parent = screenGui
  48.  
  49. wait(5)
  50. local tweenService = game:GetService("TweenService")
  51. local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  52. local tween = tweenService:Create(textLabel, tweenInfo, {TextTransparency = 1})
  53. tween:Play()
  54.  
  55. tween.Completed:Connect(function()
  56. screenGui:Destroy()
  57. end)
  58. end
  59. end)
  60.  
  61. showSpawnNotification()
  62. end
  63.  
  64. local function checkAndAddHighlight()
  65. local clientFolder = game.Workspace:FindFirstChild("Client")
  66. if clientFolder then
  67. local enemyFolder = clientFolder:FindFirstChild("Enemy")
  68. if enemyFolder then
  69. local clientEnemyPart = enemyFolder:FindFirstChild("ClientEnemy")
  70. if clientEnemyPart and clientEnemyPart:IsA("Part") then
  71. local enemyModel = clientEnemyPart:FindFirstChild("EnemyModel")
  72. if enemyModel and enemyModel:IsA("Model") then
  73. addHighlightWithDelay(enemyModel)
  74. end
  75.  
  76. clientEnemyPart.ChildAdded:Connect(function(model)
  77. if model:IsA("Model") and model.Name == "EnemyModel" then
  78. addHighlightWithDelay(model)
  79. end
  80. end)
  81. end
  82.  
  83. enemyFolder.ChildAdded:Connect(function(part)
  84. if part:IsA("Part") and part.Name == "ClientEnemy" then
  85. part.ChildAdded:Connect(function(model)
  86. if model:IsA("Model") and model.Name == "EnemyModel" then
  87. addHighlightWithDelay(model)
  88. end
  89. end)
  90.  
  91. if part:FindFirstChild("EnemyModel") then
  92. local existingModel = part:FindFirstChild("EnemyModel")
  93. if existingModel:IsA("Model") then
  94. addHighlightWithDelay(existingModel)
  95. end
  96. end
  97. end
  98. end)
  99. end
  100.  
  101. clientFolder.ChildAdded:Connect(function(subChild)
  102. if subChild:IsA("Folder") and subChild.Name == "Enemy" then
  103. subChild.ChildAdded:Connect(function(part)
  104. if part:IsA("Part") and part.Name == "ClientEnemy" then
  105. part.ChildAdded:Connect(function(model)
  106. if model:IsA("Model") and model.Name == "EnemyModel" then
  107. addHighlightWithDelay(model)
  108. end
  109. end)
  110.  
  111. if part:FindFirstChild("EnemyModel") then
  112. local existingModel = part:FindFirstChild("EnemyModel")
  113. if existingModel:IsA("Model") then
  114. addHighlightWithDelay(existingModel)
  115. end
  116. end
  117. end
  118. end)
  119. end
  120. end)
  121. end
  122. end
  123.  
  124. local function displayScriptExecutedNotification()
  125. local player = game.Players.LocalPlayer
  126. local screenGui = Instance.new("ScreenGui")
  127. screenGui.Parent = player:WaitForChild("PlayerGui")
  128.  
  129. local textLabel = Instance.new("TextLabel")
  130. textLabel.Text = "Script executed!"
  131. textLabel.TextColor3 = Color3.new(1, 1, 1) -- White color
  132. textLabel.BackgroundTransparency = 1
  133. textLabel.Size = UDim2.new(0.3, 0, 0.1, 0)
  134. textLabel.Position = UDim2.new(0.35, 0, 0.9, 0)
  135. textLabel.Font = Enum.Font.SourceSans
  136. textLabel.TextScaled = true
  137. textLabel.Parent = screenGui
  138.  
  139. local sound = Instance.new("Sound")
  140. sound.SoundId = "rbxassetid://9064294662"
  141. sound.Parent = player:WaitForChild("PlayerGui")
  142. sound:Play()
  143.  
  144. wait(5)
  145. local tweenService = game:GetService("TweenService")
  146. local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  147. local tween = tweenService:Create(textLabel, tweenInfo, {TextTransparency = 1})
  148. tween:Play()
  149.  
  150. tween.Completed:Connect(function()
  151. screenGui:Destroy()
  152. end)
  153. end
  154.  
  155. checkAndAddHighlight()
  156. displayScriptExecutedNotification()
  157.  
  158. game.Workspace.ChildAdded:Connect(function(child)
  159. if child:IsA("Folder") and child.Name == "Client" then
  160. child.ChildAdded:Connect(function(subChild)
  161. if subChild:IsA("Folder") and subChild.Name == "Enemy" then
  162. subChild.ChildAdded:Connect(function(part)
  163. if part:IsA("Part") and part.Name == "ClientEnemy" then
  164. part.ChildAdded:Connect(function(model)
  165. if model:IsA("Model") and model.Name == "EnemyModel" then
  166. addHighlightWithDelay(model)
  167. end
  168. end)
  169.  
  170. if part:FindFirstChild("EnemyModel") then
  171. local existingModel = part:FindFirstChild("EnemyModel")
  172. if existingModel:IsA("Model") then
  173. addHighlightWithDelay(existingModel)
  174. end
  175. end
  176. end
  177. end)
  178.  
  179. if subChild:FindFirstChild("ClientEnemy") then
  180. local existingPart = subChild:FindFirstChild("ClientEnemy")
  181. if existingPart:IsA("Part") then
  182. existingPart.ChildAdded:Connect(function(model)
  183. if model:IsA("Model") and model.Name == "EnemyModel" then
  184. addHighlightWithDelay(model)
  185. end
  186. end)
  187.  
  188. if existingPart:FindFirstChild("EnemyModel") then
  189. local existingModel = existingPart:FindFirstChild("EnemyModel")
  190. if existingModel:IsA("Model") then
  191. addHighlightWithDelay(existingModel)
  192. end
  193. end
  194. end
  195. end
  196. end
  197. end)
  198. end
  199. end)
Add Comment
Please, Sign In to add comment