Hello guys, today i am trying to make Trail gamepass. I made it but idk how to make it better.
local Player = game:GetService("Players").LocalPlayer
local ServerStorage = game:GetService("ServerStorage")
local BlackTrail = ServerStorage:WaitForChild("BlackTrail")
local YellowTrail = ServerStorage:WaitForChild("YellowTrail")
local OrangeTrail = ServerStorage:WaitForChild("OrangeTrail")
for _, thing in pairs(script.Parent:GetChildren()) do
if thing.ClassName == "ImageButton" then
thing.MouseButton1Click:Connect(function()
if thing:FindFirstChild("HasThis").Value == true then
if not thing:FindFirstChild("Equipped").Value == false then
thing:FindFirstChild("Equipped").Value = true
local Character = Player.Character or Player.CharacterAdded:Wait()
if thing:FindFirstChild("Color").Value == "Black" then
--idk how can i script here
elseif thing:FindFirstChild("Color").Value == "Orange" then
-idk how can i script here
elseif thing:FindFirstChild("Color").Value == "Yellow" then
-idk how can i script here
end
end
else
thing:FindFirstChild("Equipped").Value = false
end
end)
end
end

1 comment
This won't work in-game. A LocalScript cannot access ServerStorage and a Server Script cannot access LocalPlayer