local items = game.ReplicatedStorage:WaitForChild(“SwordDisplays”):GetChildren()
It is just the 7 SFOTH IV swords
[1] = Darkheart,
[2] = Firebrand,
[3] = Ghostwalker,
[4] = Ice Dagger,
[5] = Illumina,
[6] = Venomshank,
[7] = Windforce
can you print #items and see if its 0 or not
not 0
erereererererereereererererere
can try not cloning the item on the server? and clone it on the client?
What do you mean?
erereererererererer
remove :Clone() in the item variable
I think this is what you need to do. You need to clone it on the client and position it on the client with the different spawn locations. This also means that all the instances of the items and all the instances of spawnlocations need to have different names so you can fire it to the client.
This makes it not return nil on the client, but it would also stop the script from working on the server, as eventually #items
will be 0
thats what i thought aswell
ererere
clone it on the client
errerer3
or send the name and use findfirstchild with clone
wdym by clone it on the client
It works because when you clone an instance, its parent is set to nil
and that probably gets the instances also converted to nil
when sending it to the client. I recommend, you just send the random index, and let the client find the reference and clone the item itself. Since it’s stored in replicated storage, I presume the client wouldn’t have any problems accessing it. This will also reduce the network payload, since you are just sending a number instead of an instance.
just do local item = item:Clone() in ur local script
exactly what i said lol
erhejejejej
game.ReplicatedStorage.ItemSpawnClientEvent.OnClientEvent:Connect(function(item)
print(item)
local item = item:Clone()
end)
Why would you make the server send the instance over the remote event? It would be way simpler if you just pass the index or the name. Then, the client can take that item from the folder, as it knows where the folder is, and clone it.
Server
local item = items[math.random(1,#items)].Name
Client
local item = replicatedStorage:FindFirstChild(item):Clone()
I’m so confused, only one player will be able to collect the item, so I can’t do this as it will be different for everyone