Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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?

0
You will need to use remote events. Fire it from the client and let the server handle it Soban06 410 — 3y
0
Thank you! I played around with remote events and managed to get it to work. zeSauce 0 — 3y
0
When you don't have gamepass checks on serverside its easy work for exploiters sayer80 457 — 3y

1 answer

Log in to vote
0
Answered by
sayer80 457 Moderation Voter
3 years ago

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.

0
Fixed it by using RemoteEvents instead, thanks for the help anyways. zeSauce 0 — 3y
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. sayer80 457 — 3y
0
You weren't the person who answered my question tho, sorry. Also thanks for the info zeSauce 0 — 3y
0
It's still a possible solution that I've used in a Restaurant Game with 10k+ Members sayer80 457 — 3y
Ad

Answer this question