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

More efficient walljump script?

enabled = true
function onTouched(hit)
	if not enabled then return end
	enabled = false 
	local h = hit.Parent:findFirstChild("Humanoid")
	if (h ~= nil) then
		h.Sit = true
	end
	enabled = true 
end 
script.Parent.Touched:connect(onTouched) 

*Yes i know this is just a script making your character sit, but i'm not a master scripter. And when i ask for help here i get -6 reputation. So please be nice.

(no negativity allowed)

3 comments

0

I'll just add the bottom half of your Question WILL end up giving you Negative rep

0

i edited it, it still means the same.

0

What do you want?

1 answer

✓ Accepted answer

Simple! By wall jump i would assume you want to jump away form the wall. All we need to do here is add some velocity. Now a normal Vector3 would not work in this case because it would make the player jump on a specific x or z axis rather than where you want it to go. This can be fixed using a LookVector. the most efficient way to walljump is to jump backwards. A natural speed for a character to jump is 30 sps (Studs per Second). So try this!

enabled = true
function onTouched(hit)
    if not enabled then return end
    enabled = false 
    local h = hit.Parent:findFirstChild("Humanoid")
    if (h ~= nil) then
        h.Sit = true
		h.Parent.Torso.Velocity = h.Parent.Torso.CFrame.lookVector * -30 --this makes it so the player will jump in the opposite direction it is facing
    end
    enabled = true 
end 
script.Parent.Touched:connect(onTouched) 

2 comments

0

Thank you Link!, you are indeed the hero of time :D

0

No problem!

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