Robloxでプレイヤーの移動速度を変更して高速で移動できるようにする
デフォルトの値を変更する
StarterPlayerを選択する

PropertiesのCharacter内にある、CharacterWalkSpeedの値を変更する(デフォルトは16)

結果

スクリプトで移動スピードを動的に変更する
スクリプトでWalkSpeedの値を変更することでゲーム内で動的に移動スピードを調整することができる
ServerScriptServiceの配下にスクリプトを作成、名前をWalkSpeedControlに変更し、以下のように変更する。
local Players = game:GetService("Players") -- 1秒ごとに移動速度を変更する local function walkSpeedControl(character) local humanoid = character:FindFirstChildWhichIsA("Humanoid") if humanoid then while true do humanoid.WalkSpeed = 100 wait(1) humanoid.WalkSpeed = 1 wait(1) end end end -- ゲームにプレイヤーが参加し、キャラクターが追加されたらjumpHeightControlを呼び出す Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(walkSpeedControl) end)
結果
