我正在尝试使用以下规则切换通知:(顺便说一下,这是ROBLOX )
比方说,如果我按"f“,即使我按"e”或"r“,通知也不会弹出,除非我再次按"f”,然后如果我按"e“或"r”,通知将会显示。有什么想法吗?
local KeyBindHigh = "e"
local KeyBindLow = "r"
game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(Key)
if Key == KeyBindHigh then
size = size + change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
end
if Key == KeyBindLow then
size = size - change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
end
end)
发布于 2021-09-02 18:05:50
local KeyBindHigh = "e"
local KeyBindLow = "r"
game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(Key)
if Key == KeyBindHigh then
size = size + change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
elseif Key == KeyBindLow then
size = size - change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
end
end)
试试这样的东西。这可能是因为您有if语句。这应该是可行的。
发布于 2021-09-02 22:43:51
如果我没理解错的话,这就是你想要的:
local KeyBindHigh = "e"
local KeyBindLow = "r"
local KeyBindSuspend = "f"
local changeSuspended = false
game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(Key)
if Key == KeyBindSuspend then
changeSuspended = not changeSuspended
print ("changeSuspended = " .. tostring(changeSuspended))
return
end
if changeSuspended then return end
if Key == KeyBindHigh then
size = size + change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
elseif Key == KeyBindLow then
size = size - change
game.StarterGui:SetCore("SendNotification", {
Title = "~ BlackRose ~";
Text = "Reach set to " .. size;
Icon = "";
Duration = 1;})
end
end)
https://stackoverflow.com/questions/68977360
复制相似问题