Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Custom Trails not showing up to other players, how do I fix this?

So I made a "Custom Trails" Gamepass, everything works fine, but I have a problem, no one else sees the trails. Is this caused because the trail scripts are local scripts? If so how would I go about fixing this?

Here are the 3 scripts inside the gui.

Trail on script

local Button = script.Parent.Parent.textbtn
local Trail = game.ReplicatedStorage["Trail"]
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait() 

local trail = false
Button.MouseButton1Click:Connect(function()
		local CloneTrail = Trail:Clone() 
		CloneTrail.Parent = char:WaitForChild("HumanoidRootPart")

		if char:FindFirstChild("UpperTorso") then

			CloneTrail.Attachment0 = char.Head.FaceFrontAttachment

			CloneTrail.Attachment1 = char.UpperTorso.WaistRigAttachment 
	end

end)

Trail off script

local player = game.Players.LocalPlayer
local give = script.Parent

give.MouseButton1Click:connect(function()
	local char = player.Character
	char.HumanoidRootPart:ClearAllChildren()
end)

and the script for changing colors, transparency in-game.

local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

script.Parent.change.MouseButton1Click:Connect(function()
	local r = tonumber(script.Parent.r.Text)
	local g = tonumber(script.Parent.g.Text)
	local b = tonumber(script.Parent.b.Text)
	local t = tonumber(script.Parent.t.Text)
	
	local colored = char:WaitForChild("HumanoidRootPart").Trail
	colored.Color = ColorSequence.new(Color3.fromRGB(r, g, b))
	colored.Transparency = NumberSequence.new(t)
end)

They're all local scripts, if the problem is that, how can I "Convert" them into normal scripts or is it possible to do something so everyone can see the trails?

3 comments

0

You will need to use remote events. Fire it from the client and let the server handle it

0

Thank you! I played around with remote events and managed to get it to work.

0

When you don't have gamepass checks on serverside its easy work for exploiters

1 answer

To make the Trail Visible for other Players. You should better do it all on a ServerScript that checks if the player has the gamepass and then add the trail. If you have it on a localscript it will be only be visible to the player who owns it.

4 comments

0

Fixed it by using RemoteEvents instead, thanks for the help anyways.

0

Np btw. dont forget to add checks for gamepass on serverside or its an easy bypass for exploiters, would appreciate when you accept my answer.

0

You weren't the person who answered my question tho, sorry. Also thanks for the info

0

It's still a possible solution that I've used in a Restaurant Game with 10k+ Members

This discussion is preserved as it was. New answers, comments, and votes are closed.