Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make a part clicker? [closed]

Asked by 3 years ago

I want to make a game, like an easter egg hunt, where you have to find all the eggs, and when you click an egg, the counter GUI on the side goes up, but I don't know how. I'm really new to scripting and terrible at it, so if someone could help it would be much appreciated. Thanks!

0
Ok, Heres my Answer Below, RektwayYTB.. RektwayYTB 123 — 3y

Closed as Not Constructive by Soban06, RazzyPlayz, and imKirda

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Good Morning / Evening!

I heard thats you need some help with click parts, correct?

Heres some help and scripting:

  1. Insert a ClickDetector in Your Egg

  2. Edit the Distance (Default is 32)

  3. Insert in the ClickDetector a Basic Script, Which fired when Clickdetector Mouse Clicking:

Clicking Script: Inside ClickDetector, The ClickDetector is Inside the Egg

script.Parent.MouseClick:Connect(function()
       local Egg = script.Parent.Parent
       local Counter = game.StarterGui.ScreenGui.TextLabel
       local Target_Position = Vector3.new(R) -- Replace R with the Position you Want
       Egg.CFrame = CFrame.new(Target_Position)
       Counter.Text = Counter.Text + 1
end)

Next Step!

  1. Insert a ScreenGUI in StarterGUI

  2. Insert a TextLabel in ScreenGUI

  3. Customize the TextLabel if You Want

  4. Insert a LocalScript in TextLabel

Things to Understand:

Why LocalScript and Not Basic Script?

Cause The LocalScript Runs on The Client, Which is Playing Your Game And if in Basic Script, then When someone finds a egg, It gives it to everyone, and thats a bug.

LocalScript in TextLabel:

script.Parent.Changed:Connect(function()
       script.Parent.Text = "Eggs Found: "..Script.Parent.Text
end)
Ad