Can't change position via server script correctly

i wrote a script that will create new part every times i click while holding my weapon and the part will be at wanted position, however, every times i tried, the worse it gets, part position doesn’t change to wanted position but it stay at another position which is what i’m not going for

--this is server script by the way
script.Parent.Activated:Connect(function()
	local part = Instance.new("Part")
	part.Position = script.Parent.ShotPart.Position
	part.Anchored = true
	part.Parent = workspace
end)

This script works perfectly in client script, but not server script

1 Like

I have a question about wanted position.
Does your script.Parent.ShotPart.Position is the position you want?
also you can just make there Vector3.
Do you change your ShotPart.Position through the client script?
if that’s true then it can be the issue because server doesn’t see any changes from client.

Vector3.new(0,0,0) -- x,y,z

Yes, script.Parent.ShotPart.Position is the position i wanted
You meant part.Position = Vector3.new(script.Parent.ShotPart.Position)? I tried and the part just ends up at 0,0,0 position
I keep the same script and didn’t not change anything, i just move the script into cilent

I meant part.Position = Vector3.new(0,0,0) – here you can change your part’s position manually
Do you change your ShotPart.Position through the client script?
And why is your wanted position ShotPart.Position?

It’s a tool so i cannot do that as long as player move away
The last part is pretty confused me, but i think i didn’t do that
It’s where the part get shot from, you can understand the name (i tried to use other part in the tool too, but it ends up just like the same issue

Alright last question.
Do you equip your weapon from client?
If so then it can be the issue.
To equip weapon from server you can just make this

tool.Parent = character

yes.

(This text appears because charater limit)

Alright because you equip your weapon from client it means that your position of tool doesn’t change when you move.
Then you should to equip your weapon from serverside.
Also if you have your weapon in replicated storage then make sure to clone it before parenting to character.
tool:Clone().Parent = character

thanks i was busy fixing this issue for like 3 hours :skull: