Way to convert a normal script to a localscript without affecting the actual script?

so im making a game where you have to press a orb which has an specific color and assigns the same color to the torso, everything was going fine until i realized that “hints” only work on local scripts (tweenservice also works in serverscripts) but clickdetectors only work in server scripts, how can I make them work?

Problematic lines:
(Only works on localscript )

	local hint = Instance.new("Hint")
hint.Text = "..."

click detector part (server script only)

for i, orb in ipairs(folder:GetChildren()) do
	if orb:IsA("BasePart") then
		local clickDetector = orb:FindFirstChildOfClass("ClickDetector")
		local sparkles = orb:FindFirstChildOfClass("Sparkles")

		if clickDetector and sparkles then
			clickDetector.MouseClick:Connect(function(player)
				onOrbClicked(player, orb)
			end)
		else
			print("this game is broken, rejoin")
		end
	end
end

if you want more information about it, just ask me.

1 Like

You can use RemoteEvents to fire it from a server and get the event from the client. If you use FireClient(), remember to put a player in the brackets.

2 Likes
  1. Set RunContext to Client
  2. Copy the whole code and paste it into a new script.
    (This may require a new location to run, so you should probably make a more efficient system)
2 Likes

lol wait i just realized i made a big mistake i forgot to parent the hint in workspace/playergui i didn’t notice

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