Why Nostr? What is Njump?
2023-02-14 07:27:32

TZH on Nostr: local currencyMultiplier = 2 -- Replace with your desired multiplier local areaPart = ...

local currencyMultiplier = 2 -- Replace with your desired multiplier
local areaPart = game.Workspace.MultiplierArea -- Replace with the name of your "Part"
local playersInside = {} -- Keep track of players inside the area

-- Function to apply the currency multiplier to a player
local function applyMultiplier(player)
-- Replace with your currency system code
-- Example: player.leaderstats.Currency.Value = player.leaderstats.Currency.Value * currencyMultiplier
end

-- Function to remove the currency multiplier from a player
local function removeMultiplier(player)
-- Replace with your currency system code
-- Example: player.leaderstats.Currency.Value = player.leaderstats.Currency.Value / currencyMultiplier
end

-- Function to check if a player is alive
local function isPlayerAlive(player)
local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
return humanoid and humanoid.Health > 0
end

-- Detect when a player enters or leaves the area
areaPart.Touched:Connect(function(part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player and isPlayerAlive(player) then
if not playersInside[player] then
playersInside[player] = true
applyMultiplier(player)
end
end
end)

areaPart.TouchEnded:Connect(function(part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player and playersInside[player] then
playersInside[player] = nil
removeMultiplier(player)
end
end)
Author Public Key
npub1e3axwaz52trqqftmxg2v0r24n400vudfkf6gylztm84aw5ut3agsydvk4e