我正在制作一款roblox游戏的脚本,我为行走速度和跳跃能力添加了滑块。每当我"死去"的时候或者重置我的角色,滑块不再工作。
修复吗?
UILib with documentation: https://xheptcofficial.gitbook.io/kavo-library/
Walkspeed代码:
local Player = game:GetService("Players").LocalPlayer.Character.Humanoid;
--Walkspeed
WJSection:NewSlider("WalkSpeed", "Changes the player's Walkspeed", 200, 16, function(WSValue)
Player.WalkSpeed = WSValue
end)
将播放器变量设置为本地播放器,然后在滑块中设置为人形,这应该可以修复它。
local Player = game:GetService("Players").LocalPlayer
WJSection:NewSlider("WalkSpeed", "Changes the player's Walkspeed", 200, 16, function(WSValue)
Player.Character.Humanoid.WalkSpeed = WSValue
end)