道路(Part) の上を歩くほど、プレイヤー(Humanoid)のスピードが速くなります。

  1. Workspace に Part を1つ追加します。道路のように少し長めにします。
  2. Part に Script を追加します。
local function onTouch(otherPart)
    local character = otherPart.Parent
    local humanoid = character:FindFirstChildWhichIsA("Humanoid")
 
    if humanoid then    -- 上に乗ったのがプレイヤーだったら
        humanoid.WalkSpeed = humanoid.WalkSpeed + 1
        print (humanoid.WalkSpeed)
    end
end

script.Parent.Touched:Connect(onTouch)

By schilverberch

ROBLOXでゲームを作ろう! 一緒にプログラミングを学びましょう。

コメントを残す