I'm thinking of game.ServerStorage.Sentry:Clone().Parent = game.Workspace.Engineer.Torso.Position but it isn't working.
If anyone can help me complete this script it would be greatly appreciated.
I'm thinking of game.ServerStorage.Sentry:Clone().Parent = game.Workspace.Engineer.Torso.Position but it isn't working.
If anyone can help me complete this script it would be greatly appreciated.
So this is the one that works with a model:
workspace.DescendantAdded:Connect(function(descendant)
if descendant.Name=="Engineer" then
game.ServerStorage.Sentry:Clone().Parent = descendant.Torso
end
descendant.Torso.Sentry.PrimaryPart.CFrame = CFrame.new(thing.Torso.CFrame.X+5,thing.Torso.CFrame.Y,thing.Torso.CFrame.Z)
end)
This will look for an engineer if one was added, but if it already exists, then you can just have the script be:
local thing = workspace:FindFirstChild("Engineer")
game.ServerStorage.Sentry:Clone().Parent = thing.Torso
thing.Torso.Sentry.PrimaryPart.CFrame = CFrame.new(thing.Torso.CFrame.X+5,thing.Torso.CFrame.Y,thing.Torso.CFrame.Z)
Just change the CFrame.new(x,y,z) to whatever makes it go in front of your model
And this is the one that works with a single part:
workspace.DescendantAdded:Connect(function(descendant)
if descendant.Name=="Engineer" then
game.ServerStorage.Sentry:Clone().Parent = descendant.Torso
end
descendant.Torso.Sentry.CFrame = CFrame.new(thing.Torso.CFrame.X+5,thing.Torso.CFrame.Y,thing.Torso.CFrame.Z)
end)
This will look for an engineer if one was added, but if it already exists, then you can just have the script be:
local thing = workspace:FindFirstChild("Engineer")
game.ServerStorage.Sentry:Clone().Parent = thing.Torso
thing.Torso.Sentry.CFrame = CFrame.new(thing.Torso.CFrame.X+5,thing.Torso.CFrame.Y,thing.Torso.CFrame.Z)
Just change the CFrame.new(x,y,z) to whatever makes it go in front of your model
doesn't work
actually it does work with a singular part but with the sentry model im using it doesnt work.
Oh you should have said the sentry was a model
Ok it should work now, as long as you set the PrimaryPart of Sentry to somehting
My script is fine, you need to go into Sentry's properties and set the PrimaryPart to something within Sentry
Well I set a part of the sentry to the PrimaryPart and it cloned the whole thing and it didn't go infront of the model
You need to set the PrimaryPart to a part in the middle of the model
also updated my scripts to let it go infront of the model, the only thing you'll need to do is change the x y z values to make it go in front of your model. I can't do that because I don't have any more information than the stuff that you gave me
thanks
Wait can you repaste the old script that works with a singular part?
Just edited it so you have both now
Make sure to re-accept it otherwise people will think it's still unanswered
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
let me know if my answer works because I am unable to test it right now
Are you sure you have the spelling right for these things? My second script should definitely work if you got the spelling and hierarchy right.