This issue is extremely different, compared to others.
Wonder why?
The Print Statement is not working with 1, 2, 3 and even 4 Clicks, but however, it only works with 5 Clicks which is a bit Strange.
Script:
task.wait(0.1)
---------- Locals ----------
local Clicks = script.Clicks
local ClicksLimit = 5
----------------------------
-------------------- Scripting the text -------------------
script.Parent.Text = "You clicked "..Clicks.Value.." times"
-----------------------------------------------------------
script.Parent.Activated:Connect(function()
Clicks.Value = Clicks.Value + 1
repeat
task.wait(0)
script.Parent.Text = "You clicked "..Clicks.Value.." times"
until Clicks.Value == 5
if Clicks.Value >= ClicksLimit then -- ClicksLimit is 5 (You see at line 5)
script.Parent.Visible = false
script.Parent.Parent.OpenTheFrame.Visible = true
end
if Clicks.Value == 0 or script.Parent.Text == "You clicked 0 times" then
while task.wait(0.02) do
print(Clicks.Value.." out of "..ClicksLimit)
end
end
if Clicks.Value == 1 or script.Parent.Text == "You clicked 1 times" then
print(Clicks.Value.." out of "..ClicksLimit)
end
if Clicks.Value == 2 or script.Parent.Text == "You clicked 2 times" then
print(Clicks.Value.." out of "..ClicksLimit)
end
if Clicks.Value == 3 or script.Parent.Text == "You clicked 3 times" then
print(Clicks.Value.." out of "..ClicksLimit)
end
if Clicks.Value == 4 or script.Parent.Text == "You clicked 4 times" then
print(Clicks.Value.." out of "..ClicksLimit)
end
if Clicks.Value == 5 or script.Parent.Text == "You clicked 5 times" then
print(Clicks.Value.." out of "..ClicksLimit)
end
if Clicks.Value >= 6 or script.Parent.Text == "You clicked 6 times" then
script.Parent.MouseButton1Click:Once(function()
warn("You clicked too much times \n\n You clicked "..Clicks.Value.." times instead of "..ClicksLimit)
end)
wait(5)
game.Players.LocalPlayer:Kick("You have been kicked for clicking "..Clicks.Value.." times. \n \n The limit is "..ClicksLimit)
end
end)
Video:
So yeah guys, any help is appreciated.
Edit: I had this bug for around 20~30 days at this point.
You have a repeat until that wont continue until you click 5 times
Also you have a lot of repetition, those if statements where it’s if Clicks.Value == x or script.Parent.Text == "You clicked x times" then
Can be removed and only have just 1 print(Clicks.Value.." out of "..ClicksLimit), also I don’t think Signals have a Once method, if you want it to kick after they go past the limit, check if the Clicks value is greater t han the limit, to which you already did
Like I was about to do with the version 367 of the game.
But then at the Version 370 of the game i decided to remove it.
But I did it with 50 —> 37 lines.
It’s still insane, right.
task.wait(0.1)
---------- Locals ----------
local Clicks = script.Clicks
local ClicksLimit = 5
----------------------------
-------------------- Scripting the text -------------------
script.Parent.Text = "You clicked "..Clicks.Value.." times"
-----------------------------------------------------------
script.Parent.Activated:Connect(function()
Clicks.Value = Clicks.Value + 1
repeat
task.wait(0)
script.Parent.Text = "You clicked "..Clicks.Value.." times"
print(Clicks.Value.." out of "..ClicksLimit)
if Clicks.Value == 0 then
while task.wait(0.02) do
print(Clicks.Value.." out of "..ClicksLimit)
end
end
until Clicks.Value == 5
if Clicks.Value >= ClicksLimit then -- ClicksLimit is 5 (You see at line 5)
script.Parent.Visible = false
script.Parent.Parent.OpenTheFrame.Visible = true
end
if Clicks.Value >= ClicksLimit+1 then
script.Parent.MouseButton1Click:Once(function()
warn("You clicked too much times \n\n You clicked "..Clicks.Value.." times instead of "..ClicksLimit)
end)
wait(5)
game.Players.LocalPlayer:Kick("You have been kicked for clicking "..Clicks.Value.." times. \n \n The limit is "..ClicksLimit)
end
end)
However, the \n \n is not working on the Kicks.
Because of this topic and this topic and many many many more (Can’t list them all)
task.wait(0.1)
---------- Locals ----------
local Clicks = script.Clicks
local ClicksLimit = 5
----------------------------
-------------------- Scripting the text -------------------
script.Parent.Text = "You clicked "..Clicks.Value.." times"
-----------------------------------------------------------
script.Parent.Activated:Connect(function()
Clicks.Value = Clicks.Value + 1
print(Clicks.Value.." out of "..ClicksLimit)
repeat
task.wait(0)
script.Parent.Text = "You clicked "..Clicks.Value.." times"
until Clicks.Value == 5
if Clicks.Value >= ClicksLimit then -- ClicksLimit is 5 (You see at line 5)
script.Parent.Visible = false
script.Parent.Parent.OpenTheFrame.Visible = true
end
if Clicks.Value >= ClicksLimit+1 then
script.Parent.MouseButton1Click:Once(function()
warn("You clicked too much times \n\n You clicked "..Clicks.Value.." times instead of "..ClicksLimit)
end)
wait(5)
game.Players.LocalPlayer:Kick("You have been kicked for clicking "..Clicks.Value.." times. \n \n The limit is "..ClicksLimit)
end
end)
I’ve need to do the print to 1 out of 5, 2 out of 5, 3 out of 5, 4 out of 5 and 5 out of 5 right after Clicks.Value = Clicks.Value + 1.
And I’ve removed:
if Clicks.Value == 0 then
while task.wait(0.02) do
print("0 out of 5")
end
end
But… I don’t know if I can give you the solution, @EmbatTheHybrid.
I don’t think you need the repeat until, removing it wont break anything since you still have if statements to ensure you get kicked only if you go past the limit, though again I don’t think you need that Once event since if you go above the limit it should kick you there and then