Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why doesnt the item go to the backpack???

Asked by 2 years ago

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

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. crusherfire 0 — 2y
0
ok alright then Yodadthin 2 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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)
0
I did what u told me but it still doesnt work Yodadthin 2 — 2y
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) preston1196 82 — 2y
Ad

Answer this question