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

How can I make a trail activate and connect when I hold left shift?

Asked by 4 years ago
Edited by theking48989987 4 years ago

So, I've been trying to make a trail work when I hold down shift, but it keeps saying Trail isn't a valid child of Server Storage. Here's my script.

local Player = game.Players.LocalPlayer
local Character = Player.Character
local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.LeftShift then
        game.ServerStorage.Trail.Enabled = true
    else
        game.ServerStorage.Trail.Enabled = true
    end
end)

BTW I'm trying to connect it from the head to Humanoid Root Part, but didn't know how to do that.

0
Use a remote event, the client cant access anything inside the serverstorage theking48989987 2147 — 4y

1 answer

Log in to vote
0
Answered by
oreoollie 649 Moderation Voter
4 years ago
Edited 4 years ago

You're trying to access ServerStorage from the client. The entire purpose of ServerStorage is to be a secure place to keep assets from the client. I would recommend using a remote event to activate the trail.

If my answer solved your problem please remember to upvote and accept it.

Ad

Answer this question