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

Why will this value not change even if the string is in the table?

Asked by
iPxter -7
5 years ago

I currently have this remote that you can fire with some arguments. I set up a GUI on the client to fire it with some certain arguments. The only important one is the is the dmg.

This is my code. It is supposed to do this:

If your dmg is 200000000 then check your "Stand". If it is one of the whitelisted ones in the table then put the PASS value to true. If it is not one of them then make PASS false. For some reason PASS will not change even if the Stand name is in the table?

local hitbox = game.ReplicatedStorage.hitbox
local whitelistedstand = {"StarPlatinum(OverHeaven)", "TheWorld(OverHeaven)", "TuskAct4"} 
PASS = false       

hitbox.OnServerEvent:Connect(function(plr, speed, part, cframe, dmg) 
print("FIRED!")
if dmg == 200000000 then
for _, v in pairs(plr.Backpack:GetChildren()) do
local Stand = v
print(Stand)
for E = 1, #whitelistedstand do
if Stand.Name ~= whitelistedstand[E] then
PASS = false
wait(1)
print(PASS)
break
end
end
wait(1)
if PASS == true then   
print("No exploits detected")
end
if PASS == false then
print("BAN HAMMER!")
end
end
end
-- NORMAL DMG FUNCTION
end)

1 answer

Log in to vote
-1
Answered by 5 years ago
local hitbox = game.ReplicatedStorage.hitbox

local whitelistedstand = {"StarPlatinum(OverHeaven)", "TheWorld(OverHeaven)", "TuskAct4"} PASS = false

hitbox.OnServerEvent:Connect(function(plr, speed, part, cframe, dmg) print("FIRED!") if dmg == 200000000 then for _, v in pairs(plr.Backpack:GetChildren()) do local Stand = v print(Stand) for E = 1, #whitelistedstand do if Stand.Name ~= whitelistedstand[E] then PASS = false wait(1) print(PASS) break end end wait(1) if PASS == true then
print("No exploits detected") end if PASS == false then print("BAN HAMMER!") end end end -- NORMAL DMG FUNCTION end)

This should be obvious... You didn't make a check when pass will equal true. Please review your script for obvious errors please before posting here.

0
I'm not sure if I understand what you mean...? iPxter -7 — 5y
0
I thought you would read it. 1) You need an ELSE STATEMENT for other options. Let's say we have a "CHECK" for the color of an Apple. Green or Red. You would say "IF CHECK == "RED" and the apple was red it'd be true. However, if you don't specify another check to see if it's green it won't do anything. Review yourself and your basic script before asking. ItsBankai 31 — 5y
Ad

Answer this question