|
| 28 Sep 2014 08:13 AM |
How could I make it so this script doesn't have limited clicks? I mean you click it once and it plays the song. You click it twice it stops the song. And it NEVER stops. You can do it as many times are you want.
local Dubstep1 = script.Parent
clicks = 0 function click() clicks = clicks +1 -- adds 1 to clicks
if clicks >=1 then game.Workspace.Music.Dubstep1:Play() end
if clicks >= 2 then -- checks if his clicks is = or greater than 2 game.Workspace.Music.Dubstep1:Pause() end
if clicks >= 3 then -- checks if his clicks is = or greater than 2 game.Workspace.Music.Dubstep1:Play() end
end Dubstep1.MouseButton1Down:connect(click)
~~RoboticTerrorist~~ |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2014 08:27 AM |
First off this is a free model, second do it your self.
Yo mama so fat she sat on an iPhone and turned it into an iPad |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2014 08:35 AM |
@Above
First of all, sure all these people use free models: http://www.roblox.com/Forum/ShowPost.aspx?PostID=146921850
Second of all, why are you even here if you want me to do it myself? Obviously I can't do it myself or I wouldn't be asking.
~~RoboticTerrorist~~ |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 28 Sep 2014 08:45 AM |
local Dubstep1 = script.Parent
Dubstep1.MouseButton1Down:connect(function()
clicks = clicks +1 -- adds 1 to clicks
if clicks % 2 == 0 then game.Workspace.Music.Dubstep1:Pause() else game.Workspace.Music.Dubstep1:Play() end end)
How that works is when someone clicks dubstep1 it adds to clicks value and if the remainder of clicks/2 is 0 (it's divisible by 2) then pause it but if it's not divisible by 2 (it's an odd number) play it. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2014 08:50 AM |
@kodran
09:49:33.378 - Disconnected event because of exception
~~RoboticTerrorist~~ |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2014 08:50 AM |
@kodran
Wrong one. Sorry.
09:49:33.371 - Players.Player1.PlayerGui.ScreenGui.Top.Dubstep1.Twice:5: attempt to perform arithmetic on global 'clicks' (a nil value)
~~RoboticTerrorist~~ |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 28 Sep 2014 08:51 AM |
| ahh, under the Dubstep1 = script.Parent line put clicks = 0 |
|
|
| Report Abuse |
|
|