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

matching name must match int value name to move to work space.. HELP!!!??!

so guys, I have a save script, it works perfect.. vars and all are perfect but, in my replicated storage, i made a section where characters are. The characters name is why I made the script.

so far this is what i am trying to do, 2 scripts..

local a = game.Players.LocalPlayer.SaveMonsters
if script.Parent.Name == a:WaitForChild(script.Parent.Name) then
	local b = a:WaitForChild(script.Parent.Name)
	c = script.Parent:Clone(a.Value)
	c.Parent = game.Workspace
end

this is for the the item to match its int name...

then comes this to add value to my save script value

while true do
	wait()
	if script.Parent.Parent == game.Workspace then
		if script.Parent.Name == game.Players.LocalPlayer.SaveMonsters:WaitForChild(script.Parent.Name) then
			a = game.Players.LocalPlayer.SaveMonsters:WaitForChild(script.Parent.Name)
			a.Value = a.Value + 1
			script:Destroy()
		end
	end
	if script.Parent.Parent == game.Workspace.Monsters then
		if script.Parent.Name == game.Players.LocalPlayer.SaveMonsters:WaitForChild(script.Parent.Name) then
			a = game.Players.LocalPlayer.SaveMonsters:WaitForChild(script.Parent.Name)
			a.Value = a.Value + 1
			script:Destroy()
		end
	end
end

with this I am suppose to make a monsters name from the replicated storage math its name found in the save script then clone the monster and place it in workspace. how would I do this? this is really hard i would LOVE some feedback, please help!

5 comments

0

Why is your second script repeating the same thing except the second portion has game.Workspace.Monsters from the previous game.Workspace?

1

shows if its parent is .Monsters

0

this post is a train wreck

0

agreed

0

lmao the title HELP?!?!??!?

2 answers

✓ Accepted answer

New script that is not working:

function addMonstersToGameByPlayer (player, playerMonsters)
	local tableOfMonstersRetrieved = playerMonsters:GetChildren()
	for _, v in pairs(tableOfMonstersRetrieved) do
		local potentialMatch = game.ReplicatedStorage.CharactersLevelOne:FindFirstChild(v.Name)
		if potentialMatch then
			for i = 1, v.Value do
				local c = potentialMatch:Clone()
				c.Parent = game.Workspace
			end
		end
	end 
end

11 comments

4

1 year ago xDDD, Man, such a nub i was back then

0

Lol

0

Bruh my message from a year ago saying 1 year ago I was such a nub, well a year ago I was as nooby as the year before hAHha yes pls upvote this comment now, also enjoy knowing that i somehow accepted my own post

1

dumb post!!!!!

0

poop

0

yes

0

bruh that comment is from a year ago, WAIT THIS POST IS FROM 3 YEARS AGO

0

LOL

0

this entire post is sh's greatest meme

0

I know this is over a year old what you said about accepting your own post. You can't accept your own post, unless someone else who has community moderator accepts it for you, otherwise it may have been a glitch which is uncommon.

0

No, I'm pretty sure someone else accepted my own post which is amazing lmao

I don't necessarily know how to fix your issue but doesn't this look like it needs to be fixed as shown?

local a = game.Players.LocalPlayer.SaveMonsters
if script.Parent.Name == a:WaitForChild(script.Parent.Name) then
    local b = a:WaitForChild(script.Parent.Name)
    local c = script.Parent:Clone(a.Value)-- if you haven't defined the c part shouldn't you define it with a local first as shown?
    c.Parent = game.Workspace
end

1 comment

1

ik ik i c the problem, i fixed it....

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