Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Im trying to make an rebirth system and i dont know what is wrong with my script?

local replicatedStorage = game:GetService("ReplicatedStorage")
local addNewRebirthEvent = replicatedStorage("AddRebirth")
local event = Instance.new("RemoteEvent")
event.Name = "AddStats"
event.Parent = game.ReplicatedStorage

event.OnServerEvent:Connect(function(plr)
    local Taps = plr.leaderstats.Taps
    Taps.Value = Taps.Value + 1
end)

game.Players.PlayerAdded:Connect(function(plr)
    local is = Instance.new ("Folder")
    is.Name = "leaderstats"
    local Taps = Instance.new ("NumberValue", is)
    Taps.Name = "Taps"
    is.Parent = plr      
end)


local function prepareToUpdateRebirth ()
    
end
        

addNewRebirthEvent.OnServerEvent:Connect(prepareToUpdateRebirth)||`

17:37:12.856 - ServerScriptService.Script:2: attempt to call a Instance value

17:37:12.859 - Stack Begin

17:37:12.861 - Script 'ServerScriptService.Script', Line 2

17:37:12.862 - Stack End

1 comment

0

you can't do "replicatedStorage("AddRebirth") because Replicated Storage isn't a function

1 answer

✓ Accepted answer

You need to change:

replicatedStorage("AddRebirth")

to:

replicatedStorage.AddRebirth

1 comment

0

I already told him in chat, but thanks anyway

This discussion is preserved as it was. New answers, comments, and votes are closed.