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

Server Script not detecting handle size being changed. HELP?

Asked by 4 years ago

I'm trying to make an anti reach script in my sword game and it seems to not detect the handle size being changed when I change it. The original handle size is 1, 0.8, 4

Currently, I have:

local size = Vector3.new(1, 0.8, 4)

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if char:FindFirstChild("Heal") ~= nil then
            if char:FindFirstChild("Heal").Handle.Size ~= size then
                print('handle size changed')
            end
        elseif char:FindFirstChild("Heal") == nil then
            if plr.Backpack:FindFirstChild("Heal").Handle.Size ~= size then
                print('handle size changed')
            end
        end
    end)
end)
0
Changes are only detected on where it's been changed. (Server, Client) DiamondComplex 285 — 4y
0
what youre doing is only a 1 time detection, so to complicate things up, you need to make it into a while loop, but do not do that instead do: CrazyCats84 154 — 4y
0
I don't want to make this a LocalScript as exploiters can easily disable it. What would be a workaround? Can I use something like GetPropertyChangedSignal? Bin_Latin 2 — 4y
0
Yes, use GetPropertyChangedSignal("Size") on the handle. R_alatch 394 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Sorry, I typed the code wrong. I used a while true loop and it still does nothing.

How can I detect a local change from the server because exploiters can easily bypass it if it's on the client?

local size = Vector3.new(1, 0.8, 4)

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
    while true do
             if char:FindFirstChild("Heal") ~= nil then
                if char:FindFirstChild("Heal").Handle.Size ~= size then
                    print('handle size changed')
                end
            elseif char:FindFirstChild("Heal") == nil then
                if plr.Backpack:FindFirstChild("Heal").Handle.Size ~= size then
                    print('handle size changed')
                end
            end
        end
    end)
end)
Ad

Answer this question