Advertisement
sriyanto

EggSpwans

May 27th, 2023 (edited)
1,004
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.51 KB | Source Code | 1 0
  1. <link rel="stylesheet" type=text/css href="{{ url_for('static', filename='style.css') }}">
  2. <style>
  3. img {
  4.   border: 1px solid #ddd;
  5.   border-radius: 4px;
  6.   padding: 5px;
  7.   width: 150px;
  8. }
  9. img:hover {
  10.   box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
  11. }
  12. </style>
  13. {% block main %}
  14. {% endblock %}
  15. {% extends 'base.html' %}
  16. {% block main %}
  17. {% endblock %}
  18. href="{{ url_for('index') }}"
  19. Python:
  20. https://replit.com/~
  21.  
  22. Scratch:
  23. https://scratch.mit.edu/join
  24.  
  25. Roblox Studio
  26. https://www.roblox.com/create
  27.  
  28. Meeting ID:
  29. Passcode: 12345
  30. --Scratch
  31. --https://sites.google.com/view/coding9/scratch-ml/fruit-collector
  32. --Template
  33. --https://drive.google.com/file/d/1VrMKp5ZjYHxSAcKJ6TQMx8pL_KhdJKFd/view?usp=drive_link
  34. --this is script of roblox:
  35. local eggs = game.ReplicatedStorage.Eggs
  36. local spawns = game.Workspace.EggSpawns
  37. while wait(2) do --to select the random egg and spawn every 2 seconds to put it out in the location
  38.     --anything inside this while loop will keep on running for every two seconds
  39.     --create a table for all of the eggs that are present in the folder
  40.     local eggsTable = eggs:GetChildren() --This will help in getting all of the eggs in the folder
  41.    
  42.     --random egg pick out of the table
  43.     local randomEgg = eggsTable[math.random(1,#eggsTable)] --value for random will be 1 and however items are their in the table, #eggstable will give the amount of items in that table
  44.    
  45.     --create a table to choose the random spawn
  46.     local spawnsTable = spawns:GetChildren()
  47.    
  48.     --to pick a random spawn from the table
  49.     local randomSpawn = spawnsTable[math.random(1,#spawnsTable)]
  50.    
  51.     --After getting a random egg, create a clone of it to not use the egg which is their in replicated storage
  52.    
  53.     local eggClone = randomEgg:Clone()
  54.    
  55.     --to put the cloned egg in a new folder
  56.     eggClone.Parent = game.Workspace.SpawnedEggs
  57.    
  58.     --to set the position of the cloned egg
  59.     eggClone.Position = randomSpawn.Position + Vector3.new(0,20,0) --to get the current position of the random spawn and moving it to 20 studs y axis
  60.     eggClone.Anchored = false
  61.    
  62.     --touch event when the egg has been touched by the player
  63.     eggClone.Touched:Connect(function(hit) --hit is the arguement, an object which touches the egg
  64.         --when the egg has been touched, delete it
  65.         --to check whether egg has been touched by the player or not
  66.         local playr = game.Players:GetPlayerFromCharacter(hit.Parent) --this will return true or false, depending egg got hit by the players body only
  67.         if playr then
  68.             --if true
  69.             eggClone:Destroy()
  70.         end
  71.     end)
  72. end
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement