So I spawn the things but I face front it work good, I face back it spawns on my back, I spawn on left and it spawns on me? any way to fix so it goes always in front of me the stuff?
Code:
local DSS = game:GetService("DataStoreService")
local Data = DSS:GetDataStore("Data2")
local TS = game:GetService("TweenService")
local function save(plr:Player)
local save = {
plr.character.Value
}
Data:SetAsync(plr.UserId.."-data",save)
end
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local character = Instance.new("StringValue",plr)
character.Name = "character"
character.Value = "default"
if Data:GetAsync(plr.UserId.."-data")[1] ~= "" then
character.Value = Data:GetAsync(plr.UserId.."-data")[1]
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
save(plr)
end)
game.ReplicatedStorage.Remote.ShowSkillsUI.OnServerEvent:Connect(function(plr,charval,skills)
print(typeof(skills))
for i,v in skills do
local template = plr:FindFirstChild("PlayerGui").Main.Template:Clone()
template.Ability.Text = v
template.AbilityKey.Text = i
template.Parent = plr:FindFirstChild("PlayerGui").Main.Toolbar
template.Visible = true
end
end)
game.ReplicatedStorage.Remote.Ability.OnServerEvent:Connect(function(plr,skill)
print("true",skill)
if skill == "Hollow Purple" then
print("skill")
local rep = game:GetService("ReplicatedStorage")
plr.Character.Humanoid.WalkSpeed = 0
plr.Character.Humanoid.JumpPower = 0
local hollow = rep:FindFirstChild("Skills"):FindFirstChild("Hollow Purple"):Clone()
hollow.Parent = workspace
hollow.Red.Orientation = Vector3.new(-180,0,0)
hollow.Blue.Orientation = Vector3.new(-180,0,0)
hollow.Purple.Part.Transparency = 1
for _, v in pairs(hollow.Purple:GetDescendants()) do
if v:IsA("ParticleEmitter") then
v.Enabled = false
end
end
hollow:SetPrimaryPartCFrame(plr.Character.Head.CFrame - Vector3.new(0,0.5,7))
--rep.Remote.SetCameras:FireClient(plr,CFrame.new(plr.Character.Head.Position + Vector3.new(0,0,-10)))
TS:Create(hollow.Red,TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,1),{CFrame = plr.Character.Head.CFrame + Vector3.new(0,0,-7)}):Play()
TS:Create(hollow.Blue,TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,1),{CFrame = plr.Character.Head.CFrame+ Vector3.new(0,0,-7)}):Play()
task.wait(2)
TS:Create(hollow.Red,TweenInfo.new(3,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,1),{Color =Color3.fromRGB(170,100,255)}):Play()
TS:Create(hollow.Blue,TweenInfo.new(3,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,1),{Color =Color3.fromRGB(170,100,255)}):Play()
task.wait(2.5)
hollow.Purple.Part.Transparency = 0
for _, v in pairs(hollow.Purple:GetDescendants()) do
if v:IsA("ParticleEmitter") then
v.Enabled = true
end
end
hollow.Purple.CFrame = plr.Character.Head.CFrame+ Vector3.new(0,0,-7)
hollow.Red:Destroy()
hollow.Blue:Destroy()
end
end)