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

rebirth button is converting all coins to rebirths and rebirth noise is heard by all?

this is the regular script inside a textbutton in a frame in a screengui

no errors

local Part = script.Parent
	Part.MouseButton1Click:Connect(function()
		local player = script.Parent.Parent.Parent.Parent.Parent
		if player then
			local leaderstats = player:WaitForChild("leaderstats")
			local Currency = leaderstats.Rebirths
			local Selling = leaderstats.Coins
			if (Selling.Value >= 1500) then
			Currency.Value = Currency.Value + Selling.Value + 1
			Selling.Value = 0
			player.leaderstats.Changes.Value = 0
			game.Workspace.clink.Playing = true
			wait(2)
			game.Workspace.clink.Playing = false
			end
		end
	end)

Idk how to get the sound "clink" to just play for the local player, because it would not play when inside the scripts Parent.

2 comments

0

haven't i told you before, that when the person rebirths, it should just delete all data?

0

fixed that by adding player.leaderstats.Changes.Value = 0

1 answer

1.) A regular script can not find the "LocalPlayer" (Line 3) You will have to make this script a local script instead or replace line 3 with:

local player = script.Parent.Parent.Parent.Parent.Parent

2.) in line 8, you do not use "If" correctly, you got the general idea though. You need to replace line 8 with:

if (Selling.Value >= 1500 then)

1 comment

0

this kinda works, but it just converts coins to rebirths and adds 1, also the end parenthesis was at 1500 not then lol

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