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

if the player have reveice credit, that activated the function, how to fix?

I try to create a script. That make that, if the player have reveice credit, that activated the function in the LocalScript. how i can do that for this works? -Sorry for my english, i speak french.

ModuleScript:

while wait(.5) do
	local CreditsData = {
		Credits = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Credits").Value
	}
	return CreditsData
end

Local Script:

Save = require(script.Parent.CreditsSave)

deboulse = false

game.Players.LocalPlayer:WaitForChild("Credits").Changed:connect(function()
	if deboulse == false then
		if game.Players.LocalPlayer.Credits.Value > Save.Credits then
			deboulse = true
			--// Code Here
			deboulse = false
		end
	end

1 answer

I'm not sure but I think that ur problem is the Credits variable

Credits = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Credits").Value --- the .Value

Roblox takes it as Credits's parent instead of value NOTE I might be wrong. I am writing what I've noticed

Try changing the variable to

script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("Credits")

and then include .Variable next to ur past Credits variable

btw remove the loop from the Module script there is no need for

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