Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago
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

0
you can't do "replicatedStorage("AddRebirth") because Replicated Storage isn't a function DaniloKING91 -9 — 3y

1 answer

Log in to vote
0
Answered by
tjtorin 172
3 years ago

You need to change:

replicatedStorage("AddRebirth")

to:

replicatedStorage.AddRebirth
0
I already told him in chat, but thanks anyway User#30567 0 — 3y
Ad

Answer this question