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 4 years ago
Edited 4 years ago
01local replicatedStorage = game:GetService("ReplicatedStorage")
02local addNewRebirthEvent = replicatedStorage("AddRebirth")
03local event = Instance.new("RemoteEvent")
04event.Name = "AddStats"
05event.Parent = game.ReplicatedStorage
06 
07event.OnServerEvent:Connect(function(plr)
08    local Taps = plr.leaderstats.Taps
09    Taps.Value = Taps.Value + 1
10end)
11 
12game.Players.PlayerAdded:Connect(function(plr)
13    local is = Instance.new ("Folder")
14    is.Name = "leaderstats"
15    local Taps = Instance.new ("NumberValue", is)
View all 26 lines...

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 — 4y

1 answer

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

You need to change:

1replicatedStorage("AddRebirth")

to:

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

Answer this question