Jump to content
NomadFan

Bind noclip to dedicated button

Recommended Posts

As a frequent noclip user I would like to have noclip function binded to dedicated key. I think it's pretty simple to write the script if you have basic lua knowledge.
I tried to write the script myself following NomadDB guides, but I didn't succeed after 3 hours trying so I gave up and came here for help.

Share this post


Link to post
Share on other sites

Head over to data/scripts/trainer/manifest.json and add a new key binding:

"keyBinds": {
  "menu": "F4",
  "noclip": "v"
}

Then, in one of the Lua files you can do the following:

ScriptHook.RegisterKeyHandler("noclip", function()
	ScriptHook.SetLocalPlayerNoclip(not ScriptHook.HasLocalPlayerNoclip())
end)

 

Share this post


Link to post
Share on other sites
On 7/17/2020 at 10:32 PM, Freaky said:

Head over to data/scripts/trainer/manifest.json and add a new key binding:


"keyBinds": {
  "menu": "F4",
  "noclip": "v"
}

Then, in one of the Lua files you can do the following:


ScriptHook.RegisterKeyHandler("noclip", function()
	ScriptHook.SetLocalPlayerNoclip(not ScriptHook.HasLocalPlayerNoclip())
end)

 

which lua???

Share this post


Link to post
Share on other sites
1 hour ago, NMaxim said:

which lua???

You can paste this code to data/scripts/trainer/main.lua at the end of the file.

Share this post


Link to post
Share on other sites
5 minutes ago, Freaky said:

You can paste this code to data/scripts/trainer/main.lua at the end of the file.

  • When a new key is added, the cheater becomes invalid

22.jpg

11.jpg

Share this post


Link to post
Share on other sites
On 7/27/2020 at 1:33 PM, Freaky said:

You forgot a comma after the "menu: "F4" line
 

thx ,it works

and how to bind godmode? 

 

Share this post


Link to post
Share on other sites

You add a similar key binding to the json file (call it "god" or something).

Then add this to Lua, this time it's a bit more lines:

ScriptHook.RegisterKeyHandler("god", function()
	local on = not Script().StateWatcher:GetState("god")

	local playerid = GetLocalPlayerEntityId()
	Script().StateWatcher:SetState("god", on)

	if on then
		ActivateInvincibility(playerid)
		SetPawnImmuneToDeath(playerid, 1)
	else
		RemoveInvincibility(playerid)
		SetPawnImmuneToDeath(playerid, 0)
	end
end)

 

Share this post


Link to post
Share on other sites
26 minutes ago, Freaky said:

You add a similar key binding to the json file (call it "god" or something).

Then add this to Lua, this time it's a bit more lines:


ScriptHook.RegisterKeyHandler("god", function()
	local on = not Script().StateWatcher:GetState("god")

	local playerid = GetLocalPlayerEntityId()
	Script().StateWatcher:SetState("god", on)

	if on then
		ActivateInvincibility(playerid)
		SetPawnImmuneToDeath(playerid, 1)
	else
		RemoveInvincibility(playerid)
		SetPawnImmuneToDeath(playerid, 0)
	end
end)

 

WOW , thx a lot

and how to bind ingameUI , WorldSpawner  and WorldImpostor ?

Share this post


Link to post
Share on other sites

Basically, you repeat the same process over and over. You can find out the inner workings in the Trainer scripts. 

Share this post


Link to post
Share on other sites
1 hour ago, Freaky said:

Basically, you repeat the same process over and over. You can find out the inner workings in the Trainer scripts. 

plz help me to bind ingameUI ,I try one hour but failed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Nomad Group

We are a dedicated team of software & game developers, reverse engineers and most importantly gaming enthusiasts.

Our team has developed dozens of mods and toolkits and contributed to major multiplayer and game projects over the past years.

Useful Links

Legal Statement

Nomad-Group and the contents herein, are not affiliated with Ubisoft or Take-two Interactive Software Inc.

Watch_Dogs and Watch_Dogs 2 are registered trademarks of Ubisoft

Mafia 2 is a registered trademark of Take-Two Interactive Software Inc.

×
×
  • Create New...