Value is not should be "1"

Hello I made a pc hack code
but [Wht] value is should be HT2
but Wht value is 1 when remote fired
Remote Fire Code:

local userInputService = game:GetService("UserInputService")
local HackBegin = game.ReplicatedStorage.Events:WaitForChild('HackBeg')
local playerS = game:GetService("Players")
local player = playerS.LocalPlayer
local Whc = script.Parent.Parent.WhcComp
local Wht = script.Parent.Parent.WhichHT

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.E then
            warn(Wht.Value) -- this HT2
			HackBegin:FireServer(player, Whc.Value, Wht.Value)
		end
	end
end)

Remote Fired Code:

local RemoteEvent = game.ReplicatedStorage.Events:WaitForChild("HackBeg")
local MyNumb = script.Parent.MyNumber

RemoteEvent.OnServerEvent:Connect(function(player, PCN, Wht)
	if MyNumb.Value == 1 then
		 local character = player.Character
         script.Parent.ProgressMultipler.Value += 1
  		 warn(Wht) -- This not should be 1
  	     character.Torso.CFrame = script.Parent:FindFirstChild(Wht).CFrame
	end
	
  
end)

what type of value is Wht? also your system can easily get exploited.

1 Like

value type is string value. What about more secure the system?

check the values in the serverside instead.


Server Side

what i meant is
LocalScript :

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.E then
			HackBegin:FireServer(player)
		end
	end
end)

ServerScript :

local RemoteEvent = game.ReplicatedStorage.Events:WaitForChild("HackBeg")
local MyNumb = script.Parent.MyNumber
local PCN = -- Path Here
local Wht = -- Path Here
RemoteEvent.OnServerEvent:Connect(function(player)
	if MyNumb.Value == 1 then
		 local character = player.Character
         script.Parent.ProgressMultipler.Value += 1
  		 warn(Wht)
  	     character.Torso.CFrame = script.Parent:FindFirstChild(Wht).CFrame
	end
end)
1 Like