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

How do i fix my click part thing? (SOLVED)

Asked by 3 years ago
Edited 3 years ago

So im trying to make a game where basically you pop balloons for cash (ik that sounds dumb). And im doing the script where you pop the balloon but it says inifinite yield possible, how do i fix it?

local clickdetector = script.Parent:WaitForChild("ClickDetector")

clickdetector.MouseClick:Connect(function(player)
    game.Workspace.Balloon:Destroy("Ball, String")
end)
0
wait never mind i found the solution yolosolo_YT 17 — 3y

2 answers

Log in to vote
2
Answered by
2_MMZ 1059 Moderation Voter
3 years ago

If you figured out the solution yourself, then answer the question yourself in the answers, and accept it (if you can.) Or, just put (Solved) in the title of your question.

0
ok yolosolo_YT 17 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
local Players = game:GetService("Players")

local Balloon = script.Parent.Parent

local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = "rbxassetid://2375539277"

local clickdetector = script.Parent:WaitForChild("ClickDetector")

-- >>: Click Function

clickdetector.MouseClick:Connect(function(player)
    Balloon:Destroy("Ball, String")
    sound:Play()

Answer this question