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

Velocity change/ jumppower change?

I want to check if the player's color is the same color as the script's parent when the player touches the brick, then change the jump power/velocity of player if it is?

--non working script below-- --i suck at scripting--

wait()
local character = player.Character
color = character.Torso
	
if script.Parent.BrickColor == "Really Red" then
	if color.BrickColor == "Really Black" then
	function onTouch(part) 
		local human = part.Parent:findFirstChild("Humanoid") 
			if (human == nil) then return end
				Character.Humanoid.JumpPower = 100
			
end
end)
end)
end
end
script.Parent.Touched:connect(onTouch)

Im pretty sure it's the fact that idk how to check the player's color, and the part to change the jumppower of the player.

1 comment

0

what is wrong with your current code. Please give more info.

1 answer

You can't use Players.LocalPlayer in a Script, you can only use it in a Local Script.

Also, Velocity is a Vector3 value which can be set like Vector3.new(0,100,0).

You also don't need a while loop, you OnTouch event works multiple times on it's own.

Also to get the torso on line 5, it is either called Torso (capital) for R6 characters, or UpperTorso for R15.

JumpPower is part of the Player's Humanoid and can be changed like this, Character.Humanoid.JumpPower = 100

3 comments

0

Thanks! But, it still doesnt work. I updated the script so you can check it. I think it might have to do with the script checking the color of the torso on the character

0

If you check the Output in Studio or F9 in a Roblox Server, you can see the errors it may be throwing.

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