ok so I'm trying to have a command that when you send it, it inserts a script into everyone
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) player.Chatted:Connect(function(msg) if string.sub(msg, 0, 1) == "/" then if string.sub(msg, 2) == "command" then for i, plr in pairs(game.Players:GetPlayers()) do if char:FindFirstChild("TrollScript") then print("already in action") else game.ServerStorage.TrollScript:Clone(char).Name = "TrollScript" print("Added Script") end end end end end) end) end)
the issue I have is that it prints that it added the script, but if I look inside my character, there's no local script that I'm inserting.
if anyone knows what's wrong, please reply the help would be appreciated.
Clone() is a blank method that returns a clone of the Instance it was called from. It doesn't have any parameters.
You never gave the clone a Parent, so it just sits in thin air.
What I noticed is by you doing this...
Clone(char)
...you're telling the method to accept char
as an argument to...what parameter exactly? Clone() doesn't have any parameters to fill when you call it.
ok so I know what went wrong, it was in fact that there's not an argument for :Clone, when I originally was testing with cloning, I was on a world with beta features on, so it works now.