I tried to clone an object from the ReplicatedStorage, for some reason the Touched script doesn't work. I've done some research and i couldn't find much more than that it needs the Touch Transmitter or the Touch Detector, Otherwise known as the Touch Interest on a part.

I want to find a way to clone an object into the workspace with it having the Touch Interest, although the Touch Interest cant be cloned. If anyone could help thanks.

This is my original code:

script.Parent.MouseButton1Down:Connect(function()
	
	local player = game.Players.LocalPlayer
	
		if player.leaderstats.Cash.Value > 149 then
			
			player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 150
			
				
					local repstorage = game:GetService("ReplicatedStorage")
					
						repstorage.Upgraders:FindFirstChild("Upgrade1"):Clone().Parent = workspace
			
		else
			print("You dont have enough!")
		end
	
end)

1 comment

0

Don't change leaderboard data on the client since it won't appear for anyone else and hackers can easily mod their stats.