What do you want to achieve? Keep it simple and clear!
So basically when game is loaded i need to unanchor some parts
What is the issue? Include screenshots / videos if possible!
Everything goes fine before line if game:IsLoaded then
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
No i didn’t
My code:
local Players = game.Players
local RS = game:GetService("ReplicatedStorage")
local Raft = RS:WaitForChild("StarterRaft")
Players.PlayerAdded:Connect(function(player)
local RaftClone = Raft:Clone()
RaftClone.Parent = game.Workspace
if game:IsLoaded() then
local Parts = RaftClone:GetChildren()
Parts.Anchored = false
end
end)
Your problem is that game:IsLoaded() is for use on the Client Side, not the Server Side. It checks whether the game is loaded for the Client. If you remove this if statement, your code should work fine.
No i can’t remove that line of code because i need to make a RAFT(these two models) unanchored when player already can see a screen because when RAFT is unanchored instantly it just sail away from player