Strength handler not working as intended. Please Help

Hi, My stats handler for my simulator isn’t working correctly, I tried removing code, adding code, and changing variables. None worked. Does anyone know what the problem is, I checked output and I know something is wrong when I’m getting double of the same print function (Handle) each time I click once.

Stats Handler (Normal script in Serverscriptservice.)

local stats= game.ServerStorage.PlrFolder
local remoteEvent= game.ReplicatedStorage.addStrength
local update= game.ReplicatedStorage.StrengthEvent
local update2= game.ReplicatedStorage.StrengthEvent
local thePlr
	
remoteEvent.OnServerEvent:Connect(function(plr, handle, amount)
	if amount > 100 then
		plr:Kick("Nice Try Hacker")
	elseif amount < 100 then
		local pf= script.Parent.StatsHandler.plr
		print(handle)
			wait()
		
		local h= plr.Character.Humanoid
			pf.Num.Value=pf.Num.Value+1
			print(handle)
		
		for i = 1,pf.Num.Value, 1 do
			if i == 5 then i = 05	
			plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value+ 1
		if amount > 1 then
			plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value+ 5	
						
			end
				end

				local sound= Instance.new("Sound")
				game.Debris:AddItem(sound, 3)
				sound.Parent= plr.Character.LowerTorso
				sound.SoundId= "rbxassetid://565208983"
				sound.Volume=0.4
				sound:Play()
			end
		
		if pf.Num.Value >= 5 then
			pf.Num.Value=0
	end
end
end)

Weight local script.

local tool= script.Parent
local handle= tool:WaitForChild("Handle")
local plr= game.Players.LocalPlayer
repeat wait() until plr.Character
local ha= script.h

ha:InvokeServer(handle)

local c= plr.Character
local hum= plr.Character:WaitForChild("Humanoid")
local mouse= plr:GetMouse()

local idleAnim= Instance.new("Animation")
idleAnim.AnimationId= "rbxassetid://5522204593"

local actionAnim= Instance.new("Animation")
actionAnim.AnimationId= "rbxassetid://5410560986"

local animp1= hum:LoadAnimation(idleAnim)
local animp2= hum:LoadAnimation(actionAnim)

local deb= false
local timeLength= 1
local b1D

local strength= game.ReplicatedStorage.addStrength
local Speed = game.ReplicatedStorage.Speed.Value

tool.Equipped:Connect(function()
	if hum.Health <= 0 then return end
	Speed = hum.WalkSpeed
	print'equipped'
	hum.WalkSpeed=0
	animp1:Play()

	b1D= mouse.Button1Down:Connect(function()
		if hum.Health <= 0 then return end
		if deb == false then deb= true
			local breath= c:FindFirstChild("breath")
			if breath then breath.particle:Emit(1) end
			animp2:Play()
			strength:FireServer(handle, 1)
			wait(timeLength)
			animp2:Stop()
			deb=false
		end
	end)
end)

tool.Unequipped:Connect(function()
	hum.WalkSpeed= Speed
	b1D:disconnect()
	animp1:Stop()
	animp2:Stop()
end)

Aren’t you calling print() on the handle variable twice in your Server Script?
Screenshot_2020-08-24-22-37-52

3 Likes

I missed that, Thank you for your help.

2 Likes