Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Roblox Studio Lua:以现金换杀戮脚本问题_Lua_Roblox - Fatal编程技术网

Roblox Studio Lua:以现金换杀戮脚本问题

Roblox Studio Lua:以现金换杀戮脚本问题,lua,roblox,Lua,Roblox,所以,我正在做一个机器人游戏,这是一个战斗游戏。我想制作一个以现金换杀人的脚本,意思是每次杀人,杀手都会得到+10现金,而你从0现金开始。我已经有了一个脚本,见下文。我在网上什么都试过了,但都没用。甚至工具箱里的那些。但不是给杀手现金,而是给被杀者现金!我不想这是一个杀人的剧本!这是代码,我还有另一个类似的问题,它不会有帮助。它没有什么用处(它有排行榜,被杀者可以获得+10现金): 提前谢谢,希望你们能帮忙 如果不手动跟踪该信息,就无法确定玩家A杀死了玩家B 例如,如果玩家A射击一支枪,它产生的

所以,我正在做一个机器人游戏,这是一个战斗游戏。我想制作一个以现金换杀人的脚本,意思是每次杀人,杀手都会得到+10现金,而你从0现金开始。我已经有了一个脚本,见下文。我在网上什么都试过了,但都没用。甚至工具箱里的那些。但不是给杀手现金,而是给被杀者现金!我不想这是一个杀人的剧本!这是代码,我还有另一个类似的问题,它不会有帮助。它没有什么用处(它有排行榜,被杀者可以获得+10现金):


提前谢谢,希望你们能帮忙

如果不手动跟踪该信息,就无法确定玩家A杀死了玩家B

例如,如果玩家A射击一支枪,它产生的子弹可能会有一个附加的
对象值
,带有玩家A的
类人


当子弹与玩家B碰撞时,你可以很容易地返回到玩家A,并可以将KO归功于他们。

Duplicate:No its not its by me可能重复。这个问题是错误的,它不起作用,也没有得到回答。
game.Players.PlayerAdded:connect(function(player)
 local folder = Instance.new("Folder",player)
 folder.Name = "leaderstats"
 local currency1 = Instance.new("IntValue",folder)
 currency1.Name = "Cash"
 player.CharacterAdded:connect(function(character)
  character:WaitForChild("Humanoid").Died:connect(function()
  local tag = character.Humanoid:FindFirstChild("creator")
   if tag ~= nil then
    if tag.Value ~= nil then
     currency1.Value = currency1.Value + 10 --This is the reward after the 
player died.
    end
   end
  end)
 end)
end)