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

Trails following character work in Studio but not in Roblox?

Asked by 6 years ago

Ok so, I made a script to generate a orange trail behind me and increase my walkspeed when I press LShift. The Trail is located in ServerStorage and the LocalScript is in Started GUI. This script works perfectly in Studio, but when I test it out in ROBLOX not even the shift to sprint works. I tool out everything about the trail and then tested the shift to sprint and it worked. I still cant find out why shift to sprint wont work with trail. NOTE: Trail is in ServerStorage and local script is in Starter GUI. Here is the script and if you want to use it, credit me please:

local char = game.Players.LocalPlayer.Character
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char.Head
local attachment0 = Instance.new("Attachment",char.Head)
attachment0.Name = "TrailAttachment0"
local attachment1 = Instance.new("Attachment",char.Torso)
attachment1.Name = "TrailAttachment1"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Enabled = false
char.Head.Trail.Enabled = false

repeat wait() until game.Players.LocalPlayer 
local mouse = game.Players.LocalPlayer:GetMouse() 
local player = game.Players.LocalPlayer

mouse.KeyDown:connect(function(KeyDown)
if KeyDown == '0' then 
player.Character.Humanoid.WalkSpeed = 150
char.Head.Trail.Enabled = true
end
end)



mouse.KeyUp:connect(function(KeyUp)
if KeyUp == '0' then
local char = game.Players.LocalPlayer.Character
player.Character.Humanoid.WalkSpeed = 16
wait(.5)
char.Head.Trail.Enabled = false
end
end)
0
KeyDown is deprecated. See [nputBegan: http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan. Is the game FilteringEnabled? Shawnyg 4330 — 6y
0
But still, without the trail the shift to sprint worked just fine. XionGamerHD 0 — 6y

Answer this question