ジャンプ台の上だけ、高くジャンプできるように設定する

|はじめに

以前ジャンプ台を作成したものの、その後もジャンプ力が継続されたままになっていた。時間で区切って高く飛べないように設定していたがもう少し違うやり方がないか調べてみたところ、以下の機能で実装できるという記事を発見。

参考記事: https://howtoroblox-ja.com/archives/35

【使用する機能】
・Part(パーツ)
・Color(カラー)
・Script(スクリプト)
・Configuration(コンフィグレーション)
・IntValue(イント)

 

 

|これまでのScript

Script名は「GreenPart」

local GreenPart = script.Parent

function onTouched(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid then
		humanoid.JumpHeight = 100
		wait(10) -- 10秒経ったら下記のジャンプ力に戻る
		humanoid.JumpHeight = 7.2
	end
end

GreenPart.Touched:Connect(onTouched)

 

|変更点

  • Script
local Greenpart = script.Parent 
Greenpart.Velocity = Vector3.new(0, Greenpart.Configuration.IntValue.Value, 0)
  • パーツのGreenPartにConfigurationを追加し、さらにConfigurationの下にIntValueファイルを追加。IntValueのValueを200に設定。

 

すると緑のジャンプ台(GreenPart)に乗ったときのみ、高くジャンプできるようになりました。

今日はここまで。

PurpleBerry_26

ゲーム制作は全くの未経験ですが、0

Robloxアカウント:

https://www.roblox.com/users/4774737293/profile

回答

PurpleBerry_26
2023年 08⽉ 08⽇

|はじめに

以前ジャンプ台を作成したものの、その後もジャンプ力が継続されたままになっていた。時間で区切って高く飛べないように設定していたがもう少し違うやり方がないか調べてみたところ、以下の機能で実装できるという記事を発見。

参考記事: https://howtoroblox-ja.com/archives/35

【使用する機能】
・Part(パーツ)
・Color(カラー)
・Script(スクリプト)
・Configuration(コンフィグレーション)
・IntValue(イント)

 

 

|これまでのScript

Script名は「GreenPart」

local GreenPart = script.Parent

function onTouched(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid then
		humanoid.JumpHeight = 100
		wait(10) -- 10秒経ったら下記のジャンプ力に戻る
		humanoid.JumpHeight = 7.2
	end
end

GreenPart.Touched:Connect(onTouched)

 

|変更点

  • Script
local Greenpart = script.Parent 
Greenpart.Velocity = Vector3.new(0, Greenpart.Configuration.IntValue.Value, 0)
  • パーツのGreenPartにConfigurationを追加し、さらにConfigurationの下にIntValueファイルを追加。IntValueのValueを200に設定。

 

すると緑のジャンプ台(GreenPart)に乗ったときのみ、高くジャンプできるようになりました。

今日はここまで。

  • トピックに返信するにはログインしてください
2023年 08⽉ 08⽇
キャンセル

        

この機能を利⽤するには
ログインする必要があります。