Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Server Script not detecting handle size being changed. HELP?

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)

4 comments

0

Changes are only detected on where it's been changed. (Server, Client)

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:

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?

0

Yes, use GetPropertyChangedSignal("Size") on the handle.

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.