English 中文(简体)
Combo没有超过1,试图制造战斗系统(roblox)
原标题:Combo not going any higher than 1, trying to make combat system (roblox)
  • 时间:2024-01-09 02:09:46
  •  标签:
  • lua
  • roblox

I m trying to make a combat system and obviously need a combo variable to keep track of what current combo i am in

game.ReplicatedStorage.Remotes.M1.OnServerEvent:Connect(function(player, Mouse)
    print("Received M1 from the Client")
    local combo = 0
    local startTime = tick()

    if combo == 3 then
        print("M1 Combo!")
        combo = 0
    end

    if tick() - startTime >= 2 then
        combo = 0
    end

    combo = combo + 1
    print(combo)
end)

但是,这似乎从来不会超过1年,也从来不会增加1艘船。

我曾尝试在文字上添加文字上的字句(见于 com博 = bo博+1),但没有任何真正得到帮助的人会得到任何帮助!

问题回答




相关问题
Wrapping a Lua object for use in C++ with SWIG

Currently I know how to have C++ objects instantiated and passed around in Lua using SWIG bindings, what I need is the reverse. I am using Lua & C++ & SWIG. I have interfaces in C++ and ...

Can t lua_resume after async_wait?

I have some lua script that have some long running task like getting a web page so I make it yield then the C code handle get page job async, so the thread free to do other job and after a specify ...

How to remove a lua table entry by its key?

I have a lua table that I use as a hashmap, ie with string keys : local map = { foo = 1, bar = 2 } I would like to "pop" an element of this table identified by its key. There is a table.remove() ...

Lua plain string.gsub

I ve hit s small block with string parsing. I have a string like: footage/down/temp/cars_[100]_upper/cars_[100]_upper.exr and I m having difficulty using gsub to delete a portion of the string. ...

why do i get "attempt to call global require (a nil value)"?

I have 3 lua files, Init.lua, FreeCamera.lua and Camera.lua , init.lua calls require "Core.Camera.FreeCamera" Free Camera: module(...) require "Core.Camera.Camera" local M = {} FreeCamera = M M ...