Rebirth script not working

Its a TextButton, nothing else then that

I changed the script to this :


local RS = game:GetService("ReplicatedStorage")
print("Script running")

script.Parent.MouseButton1Click(function()
	print("Button pressed")
	if plr.leaderstats.Rebirths.Value == 0 and plr.leaderstats.Steps.Value >= 10000 then
		print("Rebirthing for the first time")
		RS.Events.Rebirth:FireServer()
	elseif plr.leaderstats.Rebirths.Value >= 1 and plr.leaderstats.Steps.Value >= (plr.leaderstats.Rebirths.Value * 10000) + 10000 then
		print("Not your first time? Rebirth again!")
		RS.Events.Rebirth:FireServer()
	end
end) ```


Output

20:27:40.086 Script running - Client - RebirthSend:4
20:27:40.086 Players.cooldestroyer272alt2.PlayerGui.RebirthMenu.RebirthsMenu.Button.RebirthSend:6: attempt to call a RBXScriptSignal value - Client - RebirthSend:6
20:27:40.087 Stack Begin - Studio
20:27:40.087 Script ‘Players.cooldestroyer272alt2.PlayerGui.RebirthMenu.RebirthsMenu.Button.RebirthSend’, Line 6 - Studio - RebirthSend:6
20:27:40.087 Stack End - Studio
20:27:53.277 AddStep is not a valid member of Script “Workspace.Events” - Client - LocalScript:4
20:27:53.277 Stack Begin - Studio
20:27:53.278 Script ‘Players.cooldestroyer272alt2.PlayerGui.LocalScript’, Line 4 - Studio - LocalScript:4
20:27:53.278 Stack End - Studio
20:27:56.400 Script running - Client - RebirthSend:4
20:27:56.400 Players.cooldestroyer272alt2.PlayerGui.RebirthMenu.RebirthsMenu.Button.RebirthSend:6: attempt to call a RBXScriptSignal value - Client - RebirthSend:6
20:27:56.400 Stack Begin - Studio
20:27:56.400 Script ‘Players.cooldestroyer272alt2.PlayerGui.RebirthMenu.RebirthsMenu.Button.RebirthSend’, Line 6 - Studio - RebirthSend:6
20:27:56.400 Stack End - Studio

You didn’t connect the event

local RS = game:GetService("ReplicatedStorage")
print("Script running")

script.Parent.MouseButton1Click:Connect(function()
	print("Button pressed")
	if plr.leaderstats.Rebirths.Value == 0 and plr.leaderstats.Steps.Value >= 10000 then
		print("Rebirthing for the first time")
		RS.Events.Rebirth:FireServer()
	elseif plr.leaderstats.Rebirths.Value >= 1 and plr.leaderstats.Steps.Value >= (plr.leaderstats.Rebirths.Value * 10000) + 10000 then
		print("Not your first time? Rebirth again!")
		RS.Events.Rebirth:FireServer()
	end
end) 

Oh, and btw still doesnt work so i’ll try to make a new rebirthing system, so its fine.

I’m seeing lots of plr’s but what I’m not seeing is where it is defined.

He probably just forgot to put the plr variable inside, he already defined it when the Output started

local plr = game.Players.LocalPlayer
local leaderstats = plr:WaitForChild("leaderstats")
local RS = game:GetService("ReplicatedStorage")
print("Script running")

script.Parent.MouseButton1Click:Connect(function()
	print("Button pressed")
	if leaderstats.Rebirth.Value == 0 and leaderstats.Steps.Value >= 10000 then
		print("Rebirthing for the first time")
		RS.Events.Rebirth:FireServer()
	elseif leaderstats.Rebirths.Value >= 1 and leaderstats.Steps.Value >= (plr.leaderstats.Rebirths.Value * 10000) + 10000 then
		print("Not your first time? Rebirth again!")
		RS.Events.Rebirth:FireServer()
	end
end)

i had

local plr = game.Players.LocalPlayer

in the script (ontop) and on the script you mentioned there was local plr.

Local Script or Server Script?

that was a local script, not a server

Try this varible
local Players = game:GetService(“Players”)
local plr = Players.LocalPlayer

But do we know what print statement it is getting to?

I did, still won’t work, its fine im making a new system for rebirthing

yes, Rebirth script not working - #38 by Jackscarlett under it is what i get.

Hey dood try this. First Add in a RemoteEvent in replicated storage and call it Rebirth

--Script in serverscriptservice

game.ReplicatedStorage.Rebirth.OnServerEvent:Connect(function(player)
 	local leaderstats = player:WaitForChild("leaderstats")
 	
 	leaderstats.Steps.Value = 0
 	leaderstats.Rebirth.Value += 1 --Add this in if you have a rebirth leaderstas
 end)

This Should Work!

1 Like

that worked! Thank you very much!

also i didnt use the local script part but the script in SSS worked!

Great! Make sure you make the code nicer