Why does this print, but not clone?

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")

Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(chat)
		if chat == "/UnleashHellUponThine" then
			print(chat)
			local Ball = RS.ball:Clone()
			Ball.Parent = game.Workspace
		end
	end)
end)

the print works, the rest does not.

1 Like

I tried your script, and the ball tool (I assume it’s a tool) does get copied. However, in your script, you say the ball’s parent is “Workspace”, not the player’s backpack.
Studio does copy the “ball” tool, and then move it to the workspace.

image

To have the “ball” tool in a player’s backpack, try changing

Ball.Parent = game.Workspace

to

Ball.Parent = plr.Backpack

The full script would be

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")

Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(chat)
		if chat == "/UnleashHellUponThine" then
			print(chat)
			local Ball = RS.ball:Clone()
			Ball.Parent = plr.Backpack
		end
	end)
end)
2 Likes

ball is just this dumb part i made that chases the player, not a tool

2 Likes

Ah, okay, my bad. Did not understood.
So, your script is working fine for me. I tried with a anchored part named “ball”, and it does have copied onto the workspace, and showed.

Before the command :

After :

The script you provided is working perfectly on my side.
Here’s the script in case of :

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")

Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(chat)
		if chat == "/UnleashHellUponThine" then
			print(chat)
			local Ball = RS.ball:Clone()
			Ball.Parent = game.Workspace
		end
	end)
end)
2 Likes

where do u have this script? i put mine in SSS

2 Likes

Did putt it in SSS too.
Does it show an error on your side when running though?

2 Likes

no, heres a video for it btw

3 Likes

Have you checked in the workspace if the part does not show there?
When it copies the part, it’s automatically placed where it was before you moved it to ReplicatedStorage.

2 Likes

image
all that appears

2 Likes

Weird. Does it shows an error or something in the console?
Try adding a print after the :Clone() line and the Ball.Parent = game.Workspace and see if it prints or not.

2 Likes

i tried that, and it prints. by chance do you think i should move the ball to the player? because it may be getting spawned outside of the render distance.

2 Likes

You’re using the new chat, and Player.Chatted does not work with it. Either switch to the legacy chat or search for a chat detector that works on the new chat

how do i change to the new chat? although i dont think thats the issue. because i have another game with the new chat and admin works fine on it

if you’re trying to switch to the legacy chat, where player.chatted works, click TextChatService in explorer, go to properties and find the dropdown, switch it to legacy chat.

wait o, because the function is working. the event is firing. the print works fine, the rest does not. if the signal didnt trigger then how is it printing?

yeah i knew it, new cht works fine with player.chatted. i made the part move to the player and now it works fine.
Just remember; new chat works fine with player.chatted!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.