I need help!
-
What do you want to achieve? I wanna make my own item saving system in my game, and I know that I am probably going about it in the wrong way.
-
What is the issue? It doesn’t clone the tool into my backpack, when it should be.
-
What solutions have you tried so far? I haven’t really looked, but I have tried changing the way I clone the object.
This is my script for cloning.
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local ownedtools = plr:WaitForChild("SavedTools")
if ownedtools.powerUp.Value == true then
game:GetService("ServerStorage"):WaitForChild("SuperPower"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("SuperPower"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.fireFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("FireFish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("FireFish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.pufferFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("ClassicSuperball"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("ClassicSuperball"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.grappleFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("Grapple"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("Grapple"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.rocketFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("Rocketfish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("Rocketfish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.bombFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("BombFish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("BombFish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.bigFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("BigFish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("BigFish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.laserFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("LaserFish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("LaserFish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
if ownedtools.dreamFish.Value == true then
game:GetService("ServerStorage"):WaitForChild("DreamFish"):Clone().Parent = plr:WaitForChild("Backpack")
game:GetService("ServerStorage"):WaitForChild("DreamFish"):Clone().Parent = plr:WaitForChild("OwnedTools")
end
end)
end)
Thank you!
