Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event = Instance.new("RemoteEvent",script)
- event.Name = "event"
- start = true
- stPos = Vector2.new()
- point = Vector3.new()
- dis = 0
- event.OnServerEvent:Connect(function(plyr,md,obj,hit,pos,cam,ss)
- print(plyr,md,obj,hit,pos,cam)
- if md == true then
- if start then
- start = false
- point = obj.Position - cam.Position
- stPos = pos
- dis = (pos - stPos).Magnitude
- obj.Anchored = true
- else
- local npos = pos - stPos
- npos = Vector2.new(npos.X,0-npos.Y)
- npos = npos / (ss * ((obj.Position - cam.Position).Magnitude * 10000 ))
- local Wpos = cam:VectorToWorldSpace(Vector3.new(npos.X,npos.Y,0))
- obj.Position = obj.Position + Wpos
- stPos = pos
- end
- else
- obj.Anchored = false
- start = true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement