im trying to have this module script receive the event that is being fired from this local script the module script is not receiving anything, but if i were to put it into a normal script it would work??
btw this my first post so sorry if i have done anything wrong here
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayerData = require(ServerScriptService.PlayerData.Manager)
local RebirthConfig = require(ReplicatedStorage.Configs.Rebirths)
local Remotes = ReplicatedStorage.Remotes
local Rebirth = {}
function Rebirth.Rebirth(player: Player, amount: number?)
amount = if amount then amount else 1
local profile = PlayerData.Profiles[player]
if not profile then return end
local currentRebirth = profile.Data.Rebirths
local price = RebirthConfig.CalculatePrice(currentRebirth, amount)
local canAfford = profile.Data.Clicks >= price
if not canAfford then return end
PlayerData.AdjustRebirths(player, amount)
PlayerData.AdjustClicks(player, -profile.Data.Clicks)
PlayerData.AdjustDiamonds(player, 10 * amount)
return "You rebirthed ".. amount.. " times!"
end
Remotes.RequestRebirth.OnServerEvent:Connect(function(player: Player, rebirth: string)
print("stupid")
rebirth = tonumber(rebirth)
if not rebirth then return end
Rebirth.Rebirth(player, rebirth)
end)
return Rebirth
im 100% sure theres nothing wrong with the local script that fires the event, as any other normal script would receive it