【发布时间】:2018-11-26 08:38:38
【问题描述】:
所以,我正在制作一款 Roblox 游戏,它是一款战斗游戏。我想为杀戮脚本赚取现金,这意味着每次杀戮,杀手获得+10现金,而你从0现金开始。排行榜上的名字应该是现金。有人可以为此制作一个脚本吗?我已经在网上尝试了所有方法,所以我希望你们能提供帮助。请在脚本中包含排行榜现金。提前致谢!
更新 我已经包含了脚本的代码,但不是给我现金,而是给被杀者现金。我该如何解决这个问题?
代码如下:
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)
【问题讨论】:
-
很抱歉让你们所有人都感到困惑。我会记下这个问题。顺便说一句,我只有 10 岁
-
别担心,下次尝试在您的帖子中发布一些代码:)