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

Hello im trying to make a raise a floppa game but i get this werid error?

Asked by 1 year ago
Edited 1 year ago

So basically im tryign to make a raise a floppa inspired game but this error comes up in this script

script.Parent:GetPropertyChangedSignal("Value"):Connect(function()
    game.Workspace.Square.Cigar.Transparency = 0
end)

so its like when you buy it it becoms visible and gives you x2 cash

the error says:

Cigar is not a valid member of Model "Workspace.Square"

Cigar is what the actual part that it supposed to give x2 cash and the square is the floppa. The Cigar is inside the Square. teh square is in the workspace. The Cigar is a part and teh Square is a model

0
Please elaborate, what is "square" is it a model or part, what is it? And also, what is cigar, is it a model or part, what is it? PandaKeai 10 — 1y
0
Also, what is cigars parent and square's parent? PandaKeai 10 — 1y
0
What could it mean other than that SQUARE DOESN'T EXIST IN WORKSPACE? SuperPuiu 497 — 1y

2 answers

Log in to vote
0
Answered by 1 year ago

Perhaps check that cigar is 100% a child of the square?

0
what do you mean PandaKai MLGGAME08 7 — 1y
0
Check is cigar is under squre PandaKeai 10 — 1y
Ad
Log in to vote
0
Answered by
RAFA1608 543 Moderation Voter
1 year ago

localscripts won't "have" every instance from the server for a brief moment (e.g. when the player is loading into the game) so you have to do some :WaitForChild() action, i.e.

--workspace is a constant when compared to game.Workspace
workspace:WaitForChild("Square"):WaitForChild("Cigar").Transparency = 0

also processing purchases on the client i.e. exclusively localscripts is not a good idea in my opinion

Answer this question