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").
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)