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

why doesnt the item go to the backpack???

the script is local

local ServerStorage = game:GetService("ServerStorage")
script.Parent.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
	script.Parent.Position.Y -= 10
	local copy = ServerStorage.Flowe:Clone()
	copy = playerWhoClicked.Backpack
	wait(3)
	script.Parent.Position.Y += 10
end)

so how it works is when i try to touch like a flower through click detector the item doesnt go to backpack

2 comments

0

You're trying to access server storage from a local script, which you can't do since anything in server storage is not replicated to the client. Use replicated storage for your tool instead.

0

ok alright then

1 answer

you forgot to add the ".Parent" to the copy

local ServerStorage = game:GetService("ServerStorage")
script.Parent.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
	script.Parent.Position.Y = 10
	local copy = ServerStorage.Flowe:Clone()
	copy.Parent = playerWhoClicked.Backpack
	wait(3)
	script.Parent.Position.Y = 10
end)

2 comments

0

I did what u told me but it still doesnt work

0

try this local ServerStorage = game:GetService("ServerStorage") script.Parent.ClickDetector.MouseClick:Connect(function(playerWhoClicked) script.Parent.Position.Y = 10 local copy = ServerStorage.Flowe:Clone() copy.Parent = playerWhoClicked.Backpack wait(3) script.Parent.Position.Y = 10 end)

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