trying to make a pumpkins plant teleport onto this pad when it is touched and its not workin gs please helps here is the script

local RS = game:GetService("ReplicatedStorage")

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if
			script.Parent.Taken == false then
				script.Parent.Taken = true 
			
				game.Players:FindFirstChild(hit.Parent.Name).PlayerStats.PumpkinPlace = 1
					local pump = RS.Plants.Pumpkin
					local clone = pump:Clone()
					clone.Position = script.Parent.Position
		else
			print("noob")
		end
	end
end)

2 comments

0

Is the pumpkin a model? Because if it is, the property position is not a property of models.

0

Also, if PumpkinPlace is supposed to serve as some sort of currency, you're setting it to 1, not adding 1 to it.