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

[SOLVED] How do I change the position of entire models from the ServerStorage?

function onClicked(player)
	if player.Name == "Brad_xv" then --If I press the button then,
		local crateSpawn = game:GetService("ServerStorage").Challenges.Challenge1.Crate:clone()
		crateSpawn.Parent = game.Workspace --Add to the workspace.
		crateSpawn.Position = script.Parent.Parent.CrateSpawn.Position --Change the position of the clone to "CrateSpawn".
	end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Error is on Line 5, I'm not sure how else it could be done though ("Position is not a valid member of Model").

1 answer

Nevermind. Just solved it by replacing the .Position to a :MoveTo(), stupid mistake!

function onClicked(player)
	if player.Name == "Brad_xv" then --If I press the button then,
		local crateSpawn = game:GetService("ServerStorage").Challenges.Challenge1.Crate:clone()
		crateSpawn.Parent = workspace
		crateSpawn:MoveTo(script.Parent.Parent.CrateSpawn.Position) --Changes position of the group.
	end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

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