So i tried to make a player following system but somehow i can’t set the network ownershit because its not in “workspace” while if you print it it says its the child of “workspace”. The Relic also falls out of the world. I tween it, why does it not work?
PS: this is a Script in ServerScriptService.
If you want to try it out, just make a new part in ReplicatedStorage and call it “Relic”
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local tweenInfo = TweenInfo.new(0.3)
local Relic = ReplicatedStorage.Relic
local Offset = Vector3.new(3,3,3)
local function playerAdded(player)
local function characterAdded(character)
print("A")
local relic = Relic:Clone()
local Character = player.Character
local playerPos = Character.HumanoidRootPart.Position
relic.Parent = game:GetService("Workspace")
print(relic.Parent)
--relicPrimary:SetNetworkOwner(player)
game:GetService("RunService").Stepped:Connect(function()
TweenService:Create(relic, tweenInfo, {Position = playerPos+Offset}):Play()
print(relic.Position)
end)
end
characterAdded(player.Character or player.CharacterAdded:Wait())
player.CharacterAdded:Connect(characterAdded)
end
Players.PlayerAdded:Connect(playerAdded)