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

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

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.

1 comment

0

Use a remote event, the client cant access anything inside the serverstorage

1 answer

✓ Accepted answer

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.

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