Hello again. I can't test my scripts currently because I am on a mobile device right now. I was just wondering if these scripts would work. Thanks. :)
-- Reason for the script, everytime someone clicks the screen (textButton) then the number (textbox) will go up by 1 (or 3 if you have the gamepass)-- it also will detect if someone is hacking by detecting if someone's per click is not 1 OR 3, it also makes the number go up by 10 if the player joins the game -- if someone can make a save function when the player leaves and enters the game that saves the number then that would be great. Thanks. :)
local pass = 182358984 local number = 0 local upgrade = 1 function Auth(player) return game:GetService("GamePassService"):PlayerHasPass(player, pass) end game.Players.PlayerAdded:connect(function(player) local number = number + 10 end) script.Parent.MouseButton1Click:connect(function() if Auth then local upgrade = 3 end number = number + upgrade script.Parent.Parent.Number.Text = number end) if upgrade ~= 1 or 3 then game.Players.LocalPlayer.Character:Destroy() end
-- Reason for this script: seeing is someone is speed hacking by checking if there speed is not 16
local player = game.Players.LocalPlayer.Character if player.Humanoid.WalkSpeed ~= 16 then player:Destroy() end
It appears you misunderstand if statements a bit.
If statements only run a single time. When they run, the condition will either be true or false. If it's true, the code will continue normally. If it's false, the computer will skip down to the end of the if statement.
If the condition isn't true at the exact millisecond the if statement runs, then the if statement will be skipped over and never read again. It does not matter if the condition is true later; it won't be checked again.
Instead of an if statement, use an event. An event will run whenever something happens. You can find the specific names on the wiki.
I'm not so sure about your methods for hacker prevention, but I don't know how cheat engines work so you could be correct.